Weird lambda behavior

Benjamin Peterson benjamin at python.org
Wed Apr 22 18:32:46 EDT 2009


Chris Rebert <clp2 <at> rebertia.com> writes:
> Common wart to run into as of late. fn (in the lambda) doesn't get
> evaluated until the call-time of the lambda, by which point the loop
> has finished and the loop variable has been changed to its final
> value, which is used by the lambda.

How is that a wart?






More information about the Python-list mailing list