Of what use is 'lambda'???

tye4 tye4 at yahoo.com
Mon Sep 18 21:43:27 EDT 2000


The lambda definition is limited to only one expression, and everything
you do with lambda, can also be done with plain functions.

>>> adder1 = lamda a, b : a + b
>>> def dosum(a, b):
        return a + b

>>> adder2 = dosum

>>> adder1(2, 3)
5

>>> adder2(2, 3)
5

So, does lamda have a feature that regulars funcs have or is just there
for convenience??

-tye4



More information about the Python-list mailing list