[issue7276] UnboundLocalError scoping problem with nested functions

Ole Laursen report at bugs.python.org
Mon Nov 9 12:39:16 CET 2009


Ole Laursen <olau at iola.dk> added the comment:

OK, sorry, I was under the impression that the global binding was still 
available (I can't find anything to the contrary here 
http://docs.python.org/reference/simple_stmts.html#assignment-statements 
) but it's obviously using a static definition of scope.

The error message isn't super helpful, though. :) Would it make sense to 
add a "(non-local "tmp" is shadowed)"? I guess that's easy to detect?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7276>
_______________________________________


More information about the Python-bugs-list mailing list