Click to See Complete Forum and Search --> : Anonymous function in another anonymous function


eval(BadCode)
10-31-2010, 06:50 AM
Edit: talking about python

Sometimes I see an anonymous function written like this:

F = lambda: i=i: do.something.here(i) lambda: another.anonymous.function.here(i)

It blew my mind understanding just one anonymous function, I don't understand why there's two. Is this some type of recursion or scope trick?

I wish I could find an example but it's rarely used.