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 kquick
Recipients
Date 2004-10-18.07:37:38
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=6133

Thanks for confirming this issue.

My position is that while minor, this is still a bug and not a feature.  It's good 
to detect identical lambda bodies and optimize for that case, but since 
argument binding occurs at declaration time and not execution time for 
lambdas, the bound arguments should properly be considered part of the body; 
the two lambda functions in the attached script should be disjoint.

From the practical perspective, the python backtrace was misleading in my 
debug efforts.  Internal optimizations should take second place to accuracy of 
displayed information.  func_code.co_code (and possibly others) could still be 
the same, but func_code.co_firstlineno (& func_code.co_filename) should be 
uniquely set.

Hmmm. In thinking more about this, it's not that argument binding occurs 
immediately, but moreso that defaults are supplied for arguments.  If the 
backtrace/debugger points me to a lambda function with entirely different 
default args than the ones that are applicable to the problem, then that would 
be wrong, IMHO.
History
Date User Action Args
2007-08-23 14:26:47adminlinkissue1048870 messages
2007-08-23 14:26:47admincreate