New submission from Andreas Hofmeister andreas.hofmeis...@yahoo.de:
Description:
An unexpected UnboundLocalError is produced when assigning a value to a
variable inside a nested function. The first assignment to the variable is in
the enclosing function.
Example:
def x():
a = False
New submission from Andreas Hofmeister andreas.hofmeis...@yahoo.de:
Description:
An unexpected UnboundLocalError is produced when assigning a value to a
variable inside a nested function. The first assignment to the variable is in
the enclosing function.
Example:
def x():
a = False
Andreas Hofmeister andreas.hofmeis...@yahoo.de added the comment:
Duplicate of 9049.
Sorry for the inconvenience.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9050
Andreas Hofmeister andreas.hofmeis...@yahoo.de added the comment:
Thank you for your assistance. I apologize for not examining the reference
manual closely.
Is there any way to produce the desired behavior? I currently work around the
local name binding like this:
def x():
a = [False