Not understanding lamdas and scoping

George Sakkis george.sakkis at
Wed Mar 26 22:25:31 CET 2008

On Mar 26, 5:02 pm, Joshua Kugler <jkug... at> wrote:

> I am trying to use lamdba to generate some functions, and it is not working
> the way I'd expect.  The code is below, followed by the results I'm
> getting.  More comments below that.
> (...)
> So, is there some scoping issue with lambda
> that I'm not seeing?

Yes; it's not related to lambda though but to closures (whether
defined as lambdas or regular functions). See for example

There should be an entry for this at,
that's really an FAQ.


More information about the Python-list mailing list