A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-April/153198.html below:

[Python-Dev] (name := expression) doesn't fit the narrative of PEP 20

[Python-Dev] (name := expression) doesn't fit the narrative of PEP 20Chris Angelico rosuav at gmail.com
Fri Apr 27 09:04:34 EDT 2018
On Fri, Apr 27, 2018 at 8:18 PM, Wes Turner <wes.turner at gmail.com> wrote:
> IDK, I could just be resistant to change, but this seems like something that
> will decrease readability -- and slow down code review -- without any real
> performance gain. So, while this would be useful for golfed-down (!)
> one-liners with pyline,
> I'm -1 on PEP 572.

PEP 572 has never promised a performance gain, so "without any real
performance gain" is hardly a criticism.

> How do I step through this simple example with a debugger?
>
>     if re.search(pat, text) as match:
>         print("Found:", match.group(0))

Step the 'if' statement. It will call re.search() and stash the result
in 'match'. Then the cursor would be put either on the 'print' (if the
RE matched) or on the next executable line (if it didn't).

> From https://en.wikipedia.org/wiki/Assignment_(computer_science) :
>
>> In some languages the symbol used is regarded as an operator (meaning that
>> the assignment has a value) while others define the assignment as a
>> statement (meaning that it cannot be used in an expression).
>
>
> PEP 572 -- Assignment Expressions
> PEP 572 -- Assignment Operator (:=) and Assignment Expressions

Huh? I don't get your point.

ChrisA
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4