[Python-Dev] PEP 572: Assignment Expressions

Guido van Rossum guido at python.org
Tue Apr 24 23:56:16 EDT 2018


On Tue, Apr 24, 2018 at 8:24 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:

> I also think it would be good for the PEP to spell out the following
> semantic invariant for code running in a regular namespace:
>
>     _rhs = expr
>     assert (target := _rhs) is _rhs and target is _rhs
>
> It's the restriction to single names as targets that makes it possible
> to impose such a strong assertion about what the syntax means.
>

Can you elaborate? I don't understand what you mean by this.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180424/4e22905b/attachment.html>


More information about the Python-Dev mailing list