This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abarry
Recipients Thaloss66, abarry
Date 2016-08-03.11:45:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470224729.74.0.118399997122.issue27673@psf.upfronthosting.co.za>
In-reply-to
Content
This is due to how closures work in Python: they only look up the value of the variable when the function is executed, not when it is created.

See the FAQ for more information and how to work around this: https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result
History
Date User Action Args
2016-08-03 11:45:29abarrysetrecipients: + abarry, Thaloss66
2016-08-03 11:45:29abarrysetmessageid: <1470224729.74.0.118399997122.issue27673@psf.upfronthosting.co.za>
2016-08-03 11:45:29abarrylinkissue27673 messages
2016-08-03 11:45:29abarrycreate