On 2/17/2010 5:46 PM, Lawrence D'Oliveiro wrote:
In message<hlhdsi$2p...@theodyn.ncf.ca>, cjw wrote:

Aren't lambda forms better described as function?

Is this a function?

     lambda : None

What about this?

     lambda : sys.stdout.write("hi there!\n")

To repeat: Python lambda expressions evaluate to function objects identical, except for .__name__ attribute, to the equivalent def statememnt.

>>> type(lambda:None)
<class 'function'>
>>> import sys
>>> type(lambda : sys.stdout.write("hi there!\n"))
<class 'function'>



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to