Weird lambda behavior

Benjamin Peterson benjamin at python.org
Thu Apr 23 00:32:46 CEST 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