Here's another one: >>> d = {} >>> for x in [1,2,3]: ... d[x] = (lambda z: lambda y: y * z) (x) ... >>> d[1](3) 3 >>> d[2](3) 6
-- http://mail.python.org/mailman/listinfo/python-list
Here's another one: >>> d = {} >>> for x in [1,2,3]: ... d[x] = (lambda z: lambda y: y * z) (x) ... >>> d[1](3) 3 >>> d[2](3) 6
-- http://mail.python.org/mailman/listinfo/python-list