[Python-Dev] PEP 572: Assignment Expressions

Brett Cannon brett at python.org
Wed Apr 18 12:38:02 EDT 2018


On Tue, 17 Apr 2018 at 14:53 Eric Snow <ericsnowcurrently at gmail.com> wrote:

> On Tue, Apr 17, 2018 at 7:55 AM, Steve Dower <steve.dower at python.org>
> wrote:
> > Agree with Paul. The PEP is well thought out and well presented, but I
> > really don’t think we need this in Python (and I say this as someone who
> > uses it regularly in C/C#).
> >
> > -1 on the idea; no disrespect intended toward to people who did a lot of
> > work on it.
>
> Same here.  I'm more interested in having anonymous blocks (i.e.
> scopes), along the lines of PEP 3150, though it's currently #2 on my
> wish list. :)
>

I'm also -1.

I understand the usefulness of the construct in languages where block
scopes make having this kind of expression assignment in e.g. an 'if' guard
useful. But for Python and it's LGB scoping -- although I think we need to
add an "N" for "non-local" :) -- this is syntactic sugar and I don't see
enough wide benefit on top of the potential ugliness/misuse of it to
warrant the cognitive overhead of adding it.

Although, as usual, Chris, great PEP! :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180418/a5f6aefa/attachment.html>


More information about the Python-Dev mailing list