[issue26205] Inconsistency concerning nested scopes

Terry J. Reedy report at bugs.python.org
Sun Jul 5 17:13:15 EDT 2020


Terry J. Reedy <tjreedy at udel.edu> added the comment:

At any one time, the language and interpreter sees the local scopes of enclosing functions as collectively 'nonlocal' for the purpose of accessing and rebinding.  If there are bindings of a name 'x' in multiple enclosing local scopes, the binding for 'x' in the synthesized 'nonlocal' is the innermost one.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26205>
_______________________________________


More information about the Python-bugs-list mailing list