[Python-ideas] nonlocal functions
Marcin 'Qrczak' Kowalczyk
qrczak at knm.org.pl
Wed Oct 21 20:29:07 CEST 2009
2009/10/21 Masklinn <masklinn at masklinn.net>:
>> If not, why single out assignment as a
>> special case that requires an explicit declaration of "Yes, I really do
>> want to create a new local here"?
>
> Because in all those other cases, the fact that you "really do want to
> create a new local here" is part of the statement's semantics. Why repeat
> it?
Actually in the other cases an existing variable is assigned if it was
already defined in the current scope, or it is defined if it was not -
like in the assignment syntax.
--
Marcin Kowalczyk
qrczak at knm.org.pl
More information about the Python-ideas
mailing list