[issue21904] Multiple closures accessing the same non-local variable always see the same value

Steve Holden report at bugs.python.org
Wed Jul 2 14:43:37 CEST 2014


Steve Holden added the comment:

Indeed the issue is that the pointer is to the local variable rather than its value at time of closure defnition. Not being familiar with the way cells are used, I am unsure as to how the closure keeps the whole namespace alive (that would seem to require a frame rather than just a simple cell).

----------

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


More information about the Python-bugs-list mailing list