[issue9049] UnboundLocalError in nested function

2010-06-21 Thread Andreas Hofmeister
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

[issue9050] UnboundLocalError in nested function

2010-06-21 Thread Andreas Hofmeister
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

[issue9050] UnboundLocalError in nested function

2010-06-21 Thread Andreas Hofmeister
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

[issue9049] UnboundLocalError in nested function

2010-06-21 Thread Andreas Hofmeister
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