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 arigo
Recipients
Date 2004-02-02.12:58:24
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=4771

The behavior is indeed the one described by the PEP but it is still surprising.  As far as I'm concerned it is yet another reason why free variable bindings ("nested scopes") are done wrong in Python currently :-(

If you use the older trick "lambda x,y=y:x+y" instead, then both cases will agree (with the sensible result in my opinion).  A few more issues and I'll start a campain for definition-time bindings of free variables :-(
History
Date User Action Args
2007-08-23 15:31:37adminlinkissue872326 messages
2007-08-23 15:31:37admincreate