On Fri, Jul 30, 2021 at 5:40 AM Terry Reedy wrote:
> Since the 'two ways' involve the new :=, I have no idea what 'two ways'
> and 'same result' you mean before :=.
>
I'm not sure, but I think that a lot of people read patch notes as if
they say "this is how everyone needs to do things now", and
On 7/29/2021 5:39 AM, Unknown wrote:
Hello
Reading PEP572 about Python 3.9 assignment expressions,
I discovered a subtle difference between any(a list)
and any(a generator)
see:
>>> lines = ["azerty", "#qsdfgh", "wxcvbn"]
>>> any((comment := line).startswith('#') for line in lines)
True
>>>
On Thu, Jul 29, 2021 at 7:49 PM ast wrote:
>
> Hello
>
> Reading PEP572 about Python 3.9 assignment expressions,
> I discovered a subtle difference between any(a list)
> and any(a generator)
>
> see:
>
> >>> lines = ["azerty", "#qsdfgh", "wxcvbn"]
> >>> any((comment := line).startswith('#') for
Hello
Reading PEP572 about Python 3.9 assignment expressions,
I discovered a subtle difference between any(a list)
and any(a generator)
see:
>>> lines = ["azerty", "#qsdfgh", "wxcvbn"]
>>> any((comment := line).startswith('#') for line in lines)
True
>>> comment
"#qsdfgh"
>>> any([(comment :=