Python Tutorial Was: Guido's regrets: filter and map

Bengt Richter bokr at oz.net
Tue Nov 26 09:59:19 EST 2002


On Tue, 26 Nov 2002 06:23:24 GMT, Courageous <jkraska at san.rr.com> wrote:

>
>>I find lambda quite useful for creating simple anonymous functions to pass
>>to GUIs as button commands and the like.
>
>Simple indeed. It's a consequence of the Python syntactic structure that lambdas
>shall _always_ be nothing more than a tiny little sub language in which certain
>normal Python expressions can never occur.
>
Well, you could write

     new.function(compile('print "anonymous hi"','','exec'),{})

if no one wants to pursue anonymous-def-as-expression ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list