On 03/02/2018 03:43 AM, Chris Angelico wrote:

PEP: 572
Title: Syntax for Statement-Local Name Bindings
Author: Chris Angelico <ros...@gmail.com>

Looks nice, thanks for the updates!

Alternative proposals

6. Allowing ``(EXPR as NAME)`` to assign to any form of name.

    This is exactly the same as the promoted proposal, save that the name is
    bound in the same scope that it would otherwise have. Any expression can
    assign to any name, just as it would if the ``=`` operator had been used.

Just to clarify: "bound in the same scope" means exactly that -- if the (EXPR as NAME) is in a comprehension, then it is local /to that comprehension/ (emphasis because I didn't adequately convey that it my initial response to Nick).

Still -1 to the PEP as written.  (It would be positive for alternative 6. ;)

Python-ideas mailing list
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to