[Python-ideas] Re: Syntax for late-bound arguments

2021-10-28 Thread Rob Cliffe via Python-ideas
+1 on the idea. Sometimes early binding is needed, sometimes late binding is needed.  So Python should provide both.  QED 😁 I'm not keen on the     var = > expr syntax.  IMO the arrow is pointing the wrong way.  expr is assigned to var. Some possible alternatives, if there is no technical reaso

[Python-ideas] Re: `is in`/`not is in` operators

2021-10-28 Thread Steven D'Aprano
On Thu, Oct 28, 2021 at 05:25:52PM +1100, Chris Angelico wrote: > But the "in" operator isn't built on iteration, so that would be > in-consistent. "In-"consistent, heh :-) >>> a = iter("abcde") >>> a.__contains__ Traceback (most recent call last): File "", line 1, in Att

[Python-ideas] Re: `is in`/`not is in` operators

2021-10-28 Thread Jeremiah Vivian
> What you're asking for can best be spelled with any/all and iteration, > not a new operator. I can settle with this. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.pyth

[Python-ideas] Re: `is in`/`not is in` operators

2021-10-28 Thread Jeremiah Vivian
I don't quite understand completely the major first part of your reply... ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org

[Python-ideas] Re: `is in`/`not is in` operators

2021-10-28 Thread Chris Angelico
On Thu, Oct 28, 2021 at 10:09 PM Jeremiah Vivian wrote: > > I don't quite understand completely the major first part of your reply... Please quote text so we know who you're replying to. ChrisA ___ Python-ideas mailing list -- [email protected] T

[Python-ideas] Re: `is in`/`not is in` operators

2021-10-28 Thread Chris Angelico
On Thu, Oct 28, 2021 at 9:05 PM Steven D'Aprano wrote: > > On Thu, Oct 28, 2021 at 05:25:52PM +1100, Chris Angelico wrote: > > > But the "in" operator isn't built on iteration, so that would be > > in-consistent. > > "In-"consistent, heh :-) Couldn't resist. > >>> a = iter("abcde") > >>

[Python-ideas] Re: `is in`/`not is in` operators

2021-10-28 Thread Jeremiah Vivian
> On Thu, Oct 28, 2021 at 05:25:52PM +1100, Chris Angelico wrote: >> But the "in" operator isn't built on iteration, so that would be >> in-consistent. > > "In-"consistent, heh :-) > > \>\>\> a = iter("abcde") > \>>> a.__contains__ > Traceback (most recent call last): > File "", li

[Python-ideas] Re: Python Shared Objects

2021-10-28 Thread byko3y
>This looks interesting. The 32-bit limitation is a bit of a bummer, but I suppose that can be lifted, right ? Right. Already lifted. I wasn't actually realizing that installing additional python version could cause people so much trouble. >Here's an old project trying to do more or less the same

[Python-ideas] Re: Parameter tuple unpacking in the age of positional-only arguments

2021-10-28 Thread Anselm Kiefner
At least it would make lambda parameters a little less unbearable. With `lambda a,b,/: b if b > 2 else a` instead of `lambda x: x[1] if x[1] > 2 else x[0]` I could live with. - Anselm ___ Python-ideas mailing list -- [email protected] To unsubscr

[Python-ideas] Re: `is in`/`not is in` operators

2021-10-28 Thread Christopher Barker
On Thu, Oct 28, 2021 at 3:04 AM Steven D'Aprano > The "in" operator is built on iteration, but can be overridden by the > `__contains__` method. I would say it is built on __contains__, but will fall back on iteration :-) Effectively the same, but conceptually a bit different. There is also th