Lisp-likeness

Michele Simionato michele.simionato at gmail.com
Wed Mar 16 05:40:50 EST 2005


Or, just to impress Lispers,

>>> def add(x,y):
...     return x + y
>>> closures = []
>>> for i in range(10):
...    closures.append(add.__get__(i))
...
>>> closures[5](1000)
1005

Remember, in Python do not have functions, we have descriptors! ;)

                    Michele Simionato




More information about the Python-list mailing list