Finally found a use for lambda!
Andrew Bennetts
andrew-pythonlist at puzzling.org
Mon Sep 15 05:54:49 EDT 2003
More information about the Python-list mailing list
Mon Sep 15 05:54:49 EDT 2003
- Previous message (by thread): Finally found a use for lambda!
- Next message (by thread): Finally found a use for lambda!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Sep 15, 2003 at 01:33:06AM -0700, Hannu Kankaanp?? wrote: > Roy Smith <roy at panix.com> wrote in message news:<roy-FFBAC5.22283914092003 at reader2.panix.com>... > > > > so I guess I didn't really need the lambda after all :-) > > Lambda is pretty useless in Python, unfortunately. List comprehensions > reduce their uses with filter and map, and any more complex closure > has to be written as a named function anyway.. I wish lambda would > allow statements in them also, so I could do > > func(lambda x: arr[x] = y) Well, you *could* do func(lambda x: arr.__setitem__(x, y)). But you probably shouldn't ;) -Andrew.
- Previous message (by thread): Finally found a use for lambda!
- Next message (by thread): Finally found a use for lambda!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list