[Python-Dev] Whatever happened to 'nonlocal x = y'?

Paul Moore p.f.moore at gmail.com
Fri Jan 5 18:14:16 EST 2018


On 5 January 2018 at 23:02, Guido van Rossum <guido at python.org> wrote:
> I don't like those examples -- "nonlocal foo = bar" sounds like bar is used
> as the *initializer*, but it actually is just an assignment that overwrites
> the actual initial value. IMO those shouldn't be combined.

That was my immediate reaction too. I would find the "nonlocal x =
value" version more confusing for this reason.

Paul


More information about the Python-Dev mailing list