+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
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
> 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
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
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
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")
> >>
> 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
>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
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
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
10 matches
Mail list logo