[issue12165] Does nonlocal include global?

Lukas Petru report at bugs.python.org
Wed May 25 11:47:10 CEST 2011


Lukas Petru <lukas.petru at seznam.cz> added the comment:

Well, I read that text before, but it may be because I am not native english speaker that I interpret the text differently. Let's go through it one step at a time and show me where I am wrong.

1) The nonlocal statement causes the listed identifiers to refer to previously bound variables in the nearest enclosing scope.

- I assume here that global scope is an enclosing scope (global encloses everything in the module).

2) The statement allows encapsulated code to rebind variables outside of the local scope besides the global (module) scope.

- Here I interpret "besides" as "in addition to".

Nothing specifically says that global bindings are excluded.

----------

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


More information about the Python-bugs-list mailing list