Lambda going out of fashion

Stephen Thorne stephen.thorne at gmail.com
Thu Dec 23 08:34:37 EST 2004


On Thu, 23 Dec 2004 13:47:49 +0100, Alex Martelli <aleaxit at yahoo.com> wrote:
> Nick Coghlan <ncoghlan at iinet.net.au> wrote:
>    ...
> > Perhaps something like:
> >
> > accepts_func( (def (a, b, c) to f(a) + o(b) - o(c)) )
> 
> Nice, except I think 'as' would be better than 'to'.  'as' should be a
> full keyword in 3.0 anyway (rather than a surprisingly-NOT-keyword like
> today), and "define something as somethingelse" seems marginally more
> readable to me than "define something to somethingelse" anyway.

I'm sorry, but I dislike this quite a bit, 'def arglist as expression'
just doesn't fit right for me.

After reading the discussion, and trying to glean answers to my
original questions, I realise that there's a pragmatic way of doing
the things that I mentally 'require' lambda for, without using lambda
at all. I might try and catalog lambda patterns and their alternatives
at some point.

Alex, thankyou for the feedback concerning the misuse of lambda. I
consider prevention of misuse to be much more important than the
denial of use. I recognise fully the frustration you must experience
when you see map(lambda x:f(x).

I think it is important to voice concern, and I recieved not a few
'me-too's in reply to this thread. But at the end of the day, I'm not
against removing lambda in py3k.

slightly-less-concerned-ly yr's
Stephen Thorne.



More information about the Python-list mailing list