[issue32361] global / nonlocal interference : is this a bug, a feature or a design hole ?

Ivan Levkivskyi report at bugs.python.org
Tue Dec 19 18:54:12 EST 2017


Ivan Levkivskyi <levkivskyi at gmail.com> added the comment:

Stefan, your last example is formally speaking OK, if one reads the "Execution model" literally. The original example is however too ambiguous, so it is good that it triggers an error.

I think there is a chance to improve the error message here, but I didn't think about this carefully (in particular, a situation where `global` appears after the inner function `h` definition worries me).

----------

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


More information about the Python-bugs-list mailing list