"gangesmaster" <tomerfiliba at gmail.com> writes: > so this is why [lambda: i for i in range(10)] will always return 9. > imho that's a bug, not a feature. Use [(lambda j: lambda: j)(i) for i in range(10)] or the Python idiom [(lambda i=i: i) for i in range(10)]