[docs] [issue28853] locals() and free variables
report at bugs.python.org
Sat Dec 3 07:25:03 EST 2016
Marco Buttu added the comment:
Martin, I removed the class blocks by accident. In any case, I reject the patch by myself, because to me the definition of "free variable" is not clear.
The documentation  says: "If a variable is used in a code block but not defined there, it is a free variable." According to this description, it seems to me that ``x`` is free both in ``foo()`` and in ``moo()``:
>>> def foo():
... def moo():
... return moo
But actually for the code object it is not:
Thank you for your feedback, I will continue the discussion in issue 26683.
Python tracker <report at bugs.python.org>
More information about the docs