[docs] [issue13094] Need Programming FAQ entry for the behavior of closures

Ezio Melotti report at bugs.python.org
Mon Oct 3 17:22:44 CEST 2011


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

Maybe with a different name is less confusing: lambda return_value=each: return_value
This copies the value of 'each' in a variable called 'return_value' that is local to the lambda.  Since the copy happens when the lambdas are defined, 'return_value' has then the right value.

----------

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


More information about the docs mailing list