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 r.david.murray
Recipients Christopher.King, benjamin.peterson, bogklug, r.david.murray
Date 2013-02-26.19:38:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361907519.15.0.77695181335.issue7423@psf.upfronthosting.co.za>
In-reply-to
Content
The behavior is deeply baked into how Python does closures and scoping. It shows up elsewhere than generators (eg: nested function definitions; usually encountered when using lambdas).  So, this behavior isn't going to change, it's just one of a relatively small handful of odd things you have to learn in order to grok Python.  (And yes, it is surprising...that's why there's a FAQ for it.)
History
Date User Action Args
2013-02-26 19:38:39r.david.murraysetrecipients: + r.david.murray, benjamin.peterson, bogklug, Christopher.King
2013-02-26 19:38:39r.david.murraysetmessageid: <1361907519.15.0.77695181335.issue7423@psf.upfronthosting.co.za>
2013-02-26 19:38:39r.david.murraylinkissue7423 messages
2013-02-26 19:38:38r.david.murraycreate