Unbinding a name referenced by an enclosing scope
grigory.javadyan at gmail.com
Sun Feb 20 10:07:07 CET 2011
>From the Python Language Reference (v 3.1):
> It is illegal to unbind a name referenced by an enclosing scope; the compiler will report a SyntaxError.
But when I run the following code:
a = 3
it works fine; and when I change the order of calls:
I get a NameError, not a SyntaxError. Apparently, I'm not
understanding the rule correctly. Can anyone explain it? Thanks.
More information about the Python-list