[Python-ideas] Re: IDEA: Allow override of all assignments of a built in type to be a different type

2020-03-05 Thread Andrew Barnert via Python-ideas
e that can be used to fake that), and a way to easily create a pre-hooked REPL, which together are all you need to write this as an external library. In fact, this seems almost tailor made as a perfect first use case for André’s ideas import-hook-helper library: https://github.com/aroberge/ideas _

[Python-ideas] Re: IDEA: Allow override of all assignments of a built in type to be a different type

2020-03-05 Thread Andrew Barnert via Python-ideas
On Mar 5, 2020, at 02:11, Steve Barnes wrote: > > Comments in-line (I wish Outlook would behave sensibly) > > -Original Message- > From: Paul Moore > Sent: 05 March 2020 09:52 > To: Steve Barnes > Cc: [email protected] > Subject: Re: [Python-ideas]

[Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-05 Thread Andrew Barnert via Python-ideas
gt;for B in C.__mro__: >if B in cls._explicit_only_registry: >return NotImplemented > >return cls._check_overrides_rich_comparison_methods(C) > >@classmethod >def _check_overrides_rich_comparison_methods(cls, C): >mro =

[Python-ideas] Re: New explicit methods to trim strings

2020-03-05 Thread Andrew Barnert via Python-ideas
On Mar 5, 2020, at 08:27, Christopher Barker wrote: > >> On Wed, Mar 4, 2020 at 8:13 PM Andrew Barnert via Python-ideas >> wrote: > >> Sorry, I thought I was replying to something from today, not a year ago. > > Which is fine — that conversation kind of p

[Python-ideas] Re: Exception for parameter errors

2020-03-10 Thread Marco Sulla via Python-ideas
r > Raised when an operation or function is applied to an object of inappropriate > type. etc. It's never stated that TypeError should be raised when the number of arguments is invalid, for example. It seems that TypeError itself is saying "now I'm used outside my scope" :-)

[Python-ideas] Re: prefix/suffix for bytes (was: New explicit methods to trim strings)

2020-03-10 Thread Andrew Barnert via Python-ideas
, and 64 other characters have the same byte invisibly as their second byte.) Things that are not even that ASCII-compatible include UTF-16, EBCDIC code pages, 80s Atari encoding, etc.; they are not commonly used in real-world UNIX systems. Which I think was Random’s point._______

[Python-ideas] Re: prefix/suffix for bytes (was: New explicit methods to trim strings)

2020-03-10 Thread Andrew Barnert via Python-ideas
and libc functions and most third-party functions just take a null-terminated string, meaning they silently truncate right after the first Latin-1 character, and your string is exactly one Latin-1 character long. ___ Python-ideas mailing list

[Python-ideas] Re: prefix/suffix for bytes (was: New explicit methods to trim strings)

2020-03-11 Thread Andrew Barnert via Python-ideas
he wild for str, but has anyone found examples of people doing it for bytes? _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas

[Python-ideas] Re: More appropriate behavior for the NotImplemented object

2020-03-11 Thread Andrew Barnert via Python-ideas
ike much of a problem, much less a problem worth breaking fundamental truthiness for a builtin type. ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists

[Python-ideas] Re: More appropriate behavior for the NotImplemented object

2020-03-12 Thread Marco Sulla via Python-ideas
y surprised me. I had to add a boolean() function in my little msutils module, that works also for ndarrays. And the reason ndarray do this is because it also override __eq__(): https://github.com/numpy/numpy/issues/15573 _______ Python-ideas mailing list --

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
ove x` might be more understandable, but adding new keywords is expensive > > ## Optional extension > > For consistency, `x = (del foo.attr)` and `x = (del foo[i])` could also > become legal expressions, and `__delete__`, `__delattr__`, and `__delitem__` > would now have

[Python-ideas] Re: More appropriate behavior for the NotImplemented object

2020-03-12 Thread Christopher Barker via Python-ideas
On Thu, Mar 12, 2020 at 5:50 AM Marco Sulla via Python-ideas < [email protected]> wrote: > Actually, this is the behaviour of ndarray with any dtype. And IMHO > ithis is quite terrible? I can see how you would think that. But the fact is that element-wise operations are ve

[Python-ideas] Re: More appropriate behavior for the NotImplemented object

2020-03-12 Thread Marco Sulla via Python-ideas
ements collections.abc.Sequence, even if it's really not true. Like dict: >>> help(dict) Help on class dict in module builtins: class dict(object) [...] >>> issubclass(dict, MutableMapping) True _______ Python-ideas mailing list -- p

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
sn’t. But not allowing it at all seems even more confusing. Python grammar doesn’t have a bunch of different rules for “target” for different contexts, and the few special cases it does have, people always want to un-special them the first time they run into them. _____

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
's a reference that can't be deleted, until the current scope is not finished. This in practice will break `del variable` _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://m

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
mprehensions, so there’s no difference to learn, understand, and remember. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
On Mar 12, 2020, at 10:52, Marco Sulla via Python-ideas wrote: > > On Thu, 12 Mar 2020 at 18:19, Chris Angelico wrote: >> No, it wouldn't - the use of the value as a return value counts as a >> reference. It's exactly the same as any other function that returns a

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
ble? The change you linked was done specifically for ndarrays, that you know they are immutable. How can Python know that an object is an immutable? _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-l

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
ns have to start off flagged, but then values created and used internally by numpy won’t look temporary to numpy, right? _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.p

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
on linux Type "help", "copyright", "credits" or "license" for more information. >>> from sys import getrefcount >>> a = "nfnjgjsbsjbjbsjlbslj" >>> getrefcount(a) 2 >>> a 'nfnjgjsbsjbjbsjlbslj' >>>

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
for large immutables. The problem is: how? _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mai

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
ementation, but I don't know where and what to search. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
o strings into a single object, and the CPython interpreter can intern strings at runtime, because this is guaranteed to be safe, but obviously neither can do the same thing for arbitrary objects. _______ Python-ideas mailing list -- [email protected]

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
l is that `(del bc) + d` would enter `bc.__add__(d)` with > `self` passed with a refcount of 1. So your proposal doesn’t help their problem. At best, it gives them the same behavior they already have, which they still need to optimize. _______ Python-ideas

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
On Thu, 12 Mar 2020 at 18:42, Andrew Barnert via Python-ideas wrote: > What if a for loop, instead of nexting the iterator and binding the result to > the loop variable, instead unbound the loop variable, nexted the Iterator, > and bound the result to the loop variable? I missed that.

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
this feature for __all__ Python objects. Maybe for immutable ones, but it should be done one by one, I suppose, since there's not an "immutable iterface". _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
hon 3.7 (hey, what about "no more breaking changes?" :-P) ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ M

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
On Mar 12, 2020, at 14:32, Marco Sulla via Python-ideas wrote: > On Thu, 12 Mar 2020 at 21:22, Chris Angelico wrote: >> They actually ARE already discarded > > 0O > You're right. So *how* can juliantaylor said he measured a speedup of > 2x for large ndarrays?

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
e. Only if the element of the iterable are __really__ big it could be a little improvement, but I suppose it will slow down all the other comprehensions (as Barnert already pointed out). ___________ Python-ideas mailing list -- [email protected] To un

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
On Mar 12, 2020, at 13:22, Marco Sulla wrote: > > On Thu, 12 Mar 2020 at 18:42, Andrew Barnert via Python-ideas > wrote: >> What if a for loop, instead of nexting the iterator and binding the result >> to the loop variable, instead unbound the loop variable, nexted

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
??? We are saying the same thing. On Thu, Mar 12, 2020 at 11:18 AM Marco Sulla via Python-ideas wrote: > This speedup is observed only for large objects On Fri, 13 Mar 2020 at 00:45, Ben Rudiak-Gould wrote: > it's only beneficial to try it when the array

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
Deleting Thing(abcd) - ID: 140185716001088 As you can see, Thing(abcd) has the same id of Thing(ab). So what Eric Wieser wanted is already implemented in Python, for temporary objects. _______ Python-ideas mailing list -- python-ideas@python.

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Marco Sulla via Python-ideas
observations are done by benchmarks. In the real world, how can you be sure that L2 cache is not already filled up? :-) ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Andrew Barnert via Python-ideas
real life numpy code. But those benchmarks are for a patch to numpy that’s only vaguely similar to this proposal, and neither requires it nor could benefit from it, so… ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email

[Python-ideas] Re: [email protected] post from [email protected] requires approval

2020-03-13 Thread Brett Cannon via Python-ideas
> Well, probably it depends by two possible errors: > > 1. sometimes I send directly to [email protected]. This way my > real address is used, and the system does not recognize it. I saved > the "correct" address to my contact list, so now it's more simple to > not

[Python-ideas] Re: SQL string prefix idea

2020-03-15 Thread Rob Cliffe via Python-ideas
ot; for more information. >>> r'x\'y' "x\\'y" >>> list(_) ['x', '\\', "'", 'y'] (Apologies for the double vertical spacing, I'm wrestling with my email server.) Rob Cliffe _

[Python-ideas] Re: Adding a built-in data structure with binary search tree semantics

2020-03-15 Thread Andrew Barnert via Python-ideas
die. If not, then I think the collections docs should at least link to Sorted Containers and any other relevant libraries. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.py

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-16 Thread Andrew Barnert via Python-ideas
e sense according to the same model, and should agree with C99. (I haven’t actually tested that…) _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-idea

[Python-ideas] Re: Adding a built-in data structure with binary search tree semantics

2020-03-16 Thread Andrew Barnert via Python-ideas
> On Mar 16, 2020, at 00:13, Ben Rudiak-Gould wrote: > > On Sun, Mar 15, 2020 at 9:41 PM Andrew Barnert via Python-ideas > wrote: >> Do you really want to require “binary”? > > I don't think so; they never talked about binary trees, only "binary > search

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-16 Thread Andrew Barnert via Python-ideas
at don’t match our float semantics in fundamental ways and that are derived in a more complicated way with unmotivated special cases instead of the natural way that falls out of any of the usual constructions of C in mathematics, that’s not really “maximum generality” you’re asking for, but

[Python-ideas] Re: Adding a built-in data structure with binary search tree semantics

2020-03-16 Thread Andrew Barnert via Python-ideas
looking first. At any rate, I still stand by the point that nobody is going to expect O(1) copies for sorteddict when list, dict, etc. don’t do it. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-idea

[Python-ideas] Re: Adding a built-in data structure with binary search tree semantics

2020-03-16 Thread Andrew Barnert via Python-ideas
ce to provide an API for it more > directly. > > Which, it turns out, SortedDict does, in fact, do: Yes, and it also includes things like key-slicing (“get the values for all keys a<=keyhttps://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail

[Python-ideas] Re: Adding a built-in data structure with binary search tree semantics

2020-03-16 Thread Andrew Barnert via Python-ideas
implementation just inherits dict (because it’s not a tree of items, it’s a tree of keys on top of a plain old dict). Which also means it requires keys that are _both_ hashable and weak-ordered…___________ Python-ideas mailing list -- [email protected] To

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-16 Thread Rob Cliffe via Python-ideas
olutely no offence to anyone involved. Rob Cliffe On 16/03/2020 17:33, Andrew Barnert via Python-ideas wrote: On Mar 16, 2020, at 02:54, Stephen J. Turnbull wrote: Andrew Barnert writes: Well, there are an infinite number of ever larger infinite ordinals, ω or ω_0 being the first one, and l

[Python-ideas] Re: New explicit methods to trim strings

2020-03-18 Thread Rob Cliffe via Python-ideas
es of course] Rob Cliffe _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python

[Python-ideas] Re: Syntax for loop invariants

2020-03-18 Thread Andrew Barnert via Python-ideas
t, by adding whatever code you want that gets run before and after the statement. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-idea

[Python-ideas] Re: decorator vs. 'with' analogy [was: Syntax for loop invariants]

2020-03-19 Thread Andrew Barnert via Python-ideas
On Mar 19, 2020, at 06:23, Stephen J. Turnbull wrote: > > Andrew Barnert via Python-ideas writes: > >> [A] context manager seems perfect. It allows you to hint any >> statement, including a loop statement, by adding whatever code you >> want that gets run bef

[Python-ideas] Re: Adding a built-in data structure with binary search tree semantics

2020-03-19 Thread Andrew Barnert via Python-ideas
On Mar 19, 2020, at 11:29, Marco Sulla wrote: > > On Mon, 16 Mar 2020 at 22:22, Andrew Barnert via Python-ideas > wrote: >> I think the best solution is to just not have a SortedList. C++, Java, etc. >> don’t provide anything like that > > Guava has TreeMultiset: &

[Python-ideas] Re: New explicit methods to trim strings

2020-03-21 Thread Rob Cliffe via Python-ideas
06 PM Rob Cliffe via Python-ideas mailto:[email protected]>> wrote: Consider that the start or end of a string may contain repetitions of an affix. Should `-+-+-+Spam'.stripprefix('-+')  remove just the first occurence? All of them?  Does it n

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-21 Thread Andrew Barnert via Python-ideas
ged semantics? And then, if you used _tojson, you can add the stdlib’s __json__ and the same module works as the backport of the 3.10 stdlib to older versions and as the more-featureful third-party module some people still need. _______ Python-ideas mail

[Python-ideas] Re: Instance method to test equivalence between set and iterable

2020-03-22 Thread Rob Cliffe via Python-ideas
thing it is a superset of), but I think there would be more danger of confusion with this new method. +0 on the proposal Rob Cliffe ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https

[Python-ideas] Re: Instance method to test equivalence between set and iterable

2020-03-22 Thread Andrew Barnert via Python-ideas
perfectly coherent request, and of course arbitrary iterables are relevant to it. The question is why anyone would ever need that method. If someone has a use case for it, they should be able to post it easily. _______ Python-ideas mailing list -- python-id

[Python-ideas] Re: About python3 on windows

2020-03-23 Thread Andrew Barnert via Python-ideas
the Cygwin Python 3 package install something named python3 that’s on the (Cygwin) PATH, same as on your *nix systems? _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.pytho

[Python-ideas] Re: New explicit methods to trim strings

2020-03-23 Thread Andrew Barnert via Python-ideas
nsitive equality, substring, etc. testing, none of which Python has, or should have, as long as its strings are made of code points rather than scalars (or EGCs or whatever). ___ Python-ideas mailing list -- [email protected] To unsubscribe send

[Python-ideas] Re: Instance method to test equivalence between set and iterable

2020-03-23 Thread Rob Cliffe via Python-ideas
to compare sets. (Perhaps issubset/issuperset should not accept non-set iterables, but that ship has sailed.) Rob Cliffe _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3

[Python-ideas] Re: New explicit methods to trim strings

2020-03-23 Thread Andrew Barnert via Python-ideas
ible sequence” a sensible thing, corporate team, a much worse status quo ante where strings were sequences of UTF-16 code units, a need to interface natively with Cocoa and its NFKD decomposed strings, …). For Python, it seems like if nobody’s put anything (other than thin wrappers around

[Python-ideas] Re: Instance method to test equivalence between set and iterable

2020-03-23 Thread Andrew Barnert via Python-ideas
you’re right that it’s rare enough (and easy enough to work around) that we don’t need to add anything in the first place. ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://m

[Python-ideas] Re: Instance method to test equivalence between set and iterable

2020-03-24 Thread Andrew Barnert via Python-ideas
define everything, including lists, as sets, so picking one common set of definitions arbitrarily, {1,{1,{2,{2,3 = [1,2,3] is actually true. But that isn’t relevant, and wouldn’t be relevant even if all mathematicians were always worried about foundations and always used those particular def

[Python-ideas] Re: Instance method to test equivalence between set and iterable

2020-03-24 Thread Rob Cliffe via Python-ideas
On 23/03/2020 23:49, Steven D'Aprano wrote: On Mon, Mar 23, 2020 at 02:05:49PM +, Rob Cliffe via Python-ideas wrote: s = set("a") t = list("aa") s.issubset(t) True s.issuperset(t) True but it would be misleading IMO to say that s and t are in some sense equ

[Python-ideas] Re: About python3 on windows

2020-03-25 Thread Andrew Barnert via Python-ideas
) follows the Python-on-Unix naming PEP as well as whichever linux distro inspires its packaging. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/l

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-29 Thread Andrew Barnert via Python-ideas
itten code is uncommon but does exist, and may take a bit more work to optimize than a 1-line change to optimize, but that’s acceptable—and not the responsibility of any alternate Python implementation to help with. ___ Python-ideas mailing list -- python-ideas@p

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-30 Thread Andrew Barnert via Python-ideas
ed into it before the 3.3 string redesign; I don’t know if anyone has since), but it’s still probably a major change. ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-30 Thread Andrew Barnert via Python-ideas
xamples, it’s hard not to call the string concatenation optimization a win. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.p

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-30 Thread Andrew Barnert via Python-ideas
d build a minimal “ucs4array” class with a C accelerator and then build most of the str API on top of that in pure Python. (Or, if you want the space efficiency of CPython strings, you need ucs1/ucs2/ucs4array types and a str that switches between them.) ________

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-30 Thread Andrew Barnert via Python-ideas
ead of one (with the new one less efficient and more complicated) would not be an improvement. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-30 Thread Andrew Barnert via Python-ideas
might > lead to it too.) The problem isn’t your start, it’s jumping to the assumption that StringIO must be an answer, and then not checking the docs and the code to see if there are problems, and then ignoring the problems when they’re pointed out. Why do you think a virtual file object

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-31 Thread Andrew Barnert via Python-ideas
On Mar 30, 2020, at 22:03, Steven D'Aprano wrote: > > On Mon, Mar 30, 2020 at 01:59:42PM -0700, Andrew Barnert via Python-ideas > wrote: > > [...] >> When you call getvalue() it then builds a Py_UCS4* >> representation that’s in this case 4x the size of the fin

[Python-ideas] Re: Issue 34850: Syntax Warning in the real world (is 0 / is 1)

2020-03-31 Thread Andrew Barnert via Python-ideas
, it’s hard to know which is the case here. So can you explain why this is a problem for you? _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailma

[Python-ideas] Re: PEP 9999: Retire animal-unfriendly language

2020-03-31 Thread Andrew Barnert via Python-ideas
= > > The author promises to provide a reference implementation for Python > 3.10, > should this PEP be accepted. > > > References > == > > .. _worldindata: https://ourworldindata.org/meat-production > .. _Python code of conduct: https://www.python.org/psf/conduct/ > ..

[Python-ideas] Re: PEP 9999: Retire animal-unfriendly language

2020-03-31 Thread Andrew Barnert via Python-ideas
’t get silly. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python

[Python-ideas] Re: PEP 9999: Retire animal-unfriendly language

2020-03-31 Thread Andrew Barnert via Python-ideas
ants or a tiger you were dealing with. Which is why we should all hunt and eat redwood trees rather than cows or bananas. And don’t even get me started on sunflowers. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-31 Thread Andrew Barnert via Python-ideas
just in theoretical possible implementations of Python but in multiple real life implementations, including CPython. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https

[Python-ideas] Re: Compound with .. else statement

2020-03-31 Thread Andrew Barnert via Python-ideas
it’s always been easier to show a newcomer to Python the point of for/else with a nice example than to try to explain the semantics and why they’re useful, and I assume the same would be true here. _______ Python-ideas mailing list -- [email protected]

[Python-ideas] Re: PEP 9999: Retire animal-unfriendly language

2020-04-01 Thread Andrew Barnert via Python-ideas
uot;. > > Should we deprecate the word "wheel" as well, since it's a > reference to cheese? If the Cheese Shop doesn’t actually have any cheese in stock, is it actually offensive to cows? _______ Python-ideas mailing list -- python-idea

[Python-ideas] Re: PEP 9999: Retire animal-unfriendly language

2020-04-01 Thread Andrew Barnert via Python-ideas
nsequence of the accident that our script has only two classes of letter case. I’m not aware of any human scripts that have three or more classes, but do we really want a language that’s limited to human use only?_______ Python-ideas mailing list -- python

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-04-01 Thread Andrew Barnert via Python-ideas
ring to UTF-8 when you write and then decoding back at the end. At which point you’re probably ready to give up on Python altogether. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-le...@python.

[Python-ideas] Re: [Python-Dev] reversed enumerate

2020-04-01 Thread Andrew Barnert via Python-ideas
t do you get? You presumably don’t even need to look that up or try it out. It would be pretty confusing if it were different without the tuple. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] ht

[Python-ideas] Re: Changing Package Representation On Shell

2020-04-02 Thread Andrew Barnert via Python-ideas
where you plan to print out that repr, how you’d like to specify it within the module source, etc. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-04-02 Thread Andrew Barnert via Python-ideas
with a C implementation—it can just check if CPython and if so use a str as its buffer… but for a builtin member of a stdlib module, that’s probably not acceptable.) ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email t

[Python-ideas] Re: Changing Package Representation On Shell

2020-04-02 Thread Andrew Barnert via Python-ideas
On Apr 2, 2020, at 13:35, Abdur-Rahmaan Janhangeer wrote: > >> On Thu, Apr 2, 2020 at 8:15 PM Andrew Barnert wrote: >> >> Why should modules break all of that, and be different from strings, tuples, >> functions, classes, etc.? > > python-ideas is

[Python-ideas] Re: macaddress or networkaddress module

2020-04-04 Thread Andrew Barnert via Python-ideas
fore they’re proposed for inclusion (and then converted into a backport after inclusion). Although again, the process should be a lot easier with macaddress than with something as complicated as regex or as unprecedented as tulip. ___ Python-ideas mailing li

[Python-ideas] Re: macaddress or networkaddress module

2020-04-04 Thread Andrew Barnert via Python-ideas
e helpful. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@p

[Python-ideas] Re: macaddress or networkaddress module

2020-04-05 Thread Andrew Barnert via Python-ideas
looks like for the last decade its needed less than one bugfix or feature per year for dealing with MAC/EUI addresses… _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mai

[Python-ideas] Re: macaddress or networkaddress module

2020-04-05 Thread Andrew Barnert via Python-ideas
> On Apr 5, 2020, at 20:12, Stephen J. Turnbull > wrote: > > Andrew Barnert via Python-ideas writes: > >> However, I think that a macaddress library could easily be one of >> the few things that does properly fit in the networking section of >> the stdlib. It

[Python-ideas] Re: Improvement: __json__

2020-04-06 Thread Andrew Barnert via Python-ideas
f course JSON isn’t perfect, as anyone who’s tried to interchange, say, int64 values discovers… but it’s good enough for many applications.) _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-i

[Python-ideas] Re: Improvement: __json__

2020-04-06 Thread Andrew Barnert via Python-ideas
ch instead of a method protocol. Have a bunch of existing code from another project that used simplejson? Use its tojson protocol, and you don’t need to fork every class just to change the name. And so on. ___________ Python-ideas mailing list -- python-ideas@pyt

[Python-ideas] Re: Improvement: __json__

2020-04-07 Thread Andrew Barnert via Python-ideas
. Either way seems like it makes sense. A schema generator for dataclasses, I think you’d want it to use the typing information. A MyClass property a doesn’t just have an attribute of {“type”: “array”}; it has a {“type”: “array”, “contains”: recursively_schematize(A_Type)}.________

[Python-ideas] Re: "except BaseException with f as result"

2020-04-07 Thread Andrew Barnert via Python-ideas
ing bound to something to do with f. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/l

[Python-ideas] Re: Improvement: __json__

2020-04-08 Thread Andrew Barnert via Python-ideas
ns add is JSON serialization that’s human readable/editable, or computer verifiable, or both. You don’t need JSON-LD unless you’re not just building APIs, but meta-indexes of APIs or automatic API generators or something. _______ Python-ideas mailing list -- pyth

[Python-ideas] Re: Live variable analysis -> earlier release?

2020-04-08 Thread Andrew Barnert via Python-ideas
y do, and then undo if the guard triggers, which was I think his key idea. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message

[Python-ideas] Re: Improvement: __json__

2020-04-08 Thread Andrew Barnert via Python-ideas
a, and so on. All of which are useful. ___________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives

[Python-ideas] Re: Improvement: __json__

2020-04-08 Thread Andrew Barnert via Python-ideas
nd that’s also fine. Would it better serve the needs of the semantic web if the email format were a mandatory rather than optional part of the spec and everyone were required by law to always use it when storing email addresses? Maybe. But neither of those things are true. ____

[Python-ideas] Re: Optimize out unused variables

2020-04-08 Thread Andrew Barnert via Python-ideas
d see if there are any cases where it’s useful, but only with the restrictions relaxed, and maybe use that as a guide to whether it’s worth finding a way to aim for looser restrictions in the first place or not. _______ Python-ideas mailing list -- py

[Python-ideas] Re: Live variable analysis -> earlier release?

2020-04-09 Thread Andrew Barnert via Python-ideas
ore complicated than in CPython. But the PyPy guys seem to be really good at figuring out how to test such questions empirically. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] htt

[Python-ideas] Re: Live variable analysis -> earlier release?

2020-04-09 Thread Andrew Barnert via Python-ideas
unting completely disabled) in C and other languages, and there’s no reason (if you’re really careful) it couldn’t work in Python. But it’s certainly not the behavior you’d want from a general-purpose Python implementation.___ Python-ideas mailing list -

[Python-ideas] Re: Exception spaces

2020-04-10 Thread Andrew Barnert via Python-ideas
or that your tone doesn’t fit the style or the Python community, or whatever, I don’t think so. Look at the proposal to change variable deletion time—that’s gotten a ton of pushback, and it’s certainly not because nobody respects Guido or nobody likes him. ______

[Python-ideas] Re: Range of Indexes

2020-04-10 Thread Andrew Barnert via Python-ideas
ason those functions are in itertools rather than builtins.) But those are unusual cases. Which means they usually deserve to be called out. A change that makes it look less visible and less unusual would actually be counterproductive. _______ Python-idea

[Python-ideas] Re: RFC: For Loop Invariants

2020-04-10 Thread Andrew Barnert via Python-ideas
nts in there or any flow control besides the linear-nested clauses. That doesn’t apply to nested blocks. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org

[Python-ideas] Re: Proposed class for collections: dynamicdict

2020-04-10 Thread Andrew Barnert via Python-ideas
would be different if it were invented today.) _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at ht

[Python-ideas] Re: Exception spaces

2020-04-11 Thread Andrew Barnert via Python-ideas
anyway. But for the vast majority of code, they’re both great. _______ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at

<    6   7   8   9   10   11   12   13   14   15   >