Draft Pep (was: Re: Let's Talk About Lambda Functions!)

Andrae Muys amuys at shortech.com.au
Wed Aug 7 02:37:31 CEST 2002

pinard at iro.umontreal.ca (=?iso-8859-1?q?Fran=E7ois?= Pinard) wrote in message news:<mailman.1028553188.1405.python-list at python.org>...
> I question that there is any real "need" for `lambda'.  Wherever `lambda'
> would do, `def' does.  The main price to pay is having to choose an
> initial name for the function, and undoubtedly, choosing a name requires
> bits of energy[1].  Yet, by choosing a meaningful name, people have a
> wonderful opportunity at using it as a kind of minimal documentation, and
> legibility wins -- so that price is a fallacy in the long run.  Using `def'
> has still a price in the form of a bit more vertical space in the sources:
> if `lambda' was extremely frequent, this might be worth some pondering.

Except of course for the issue of context.  There are times when being
able to define a function within the context of its use is better
documentation then any name.  For one example see Huaiyu Zhu's post to
this thread Message-ID: <slrnaktho4.116.huaiyu at gauss.almadan.ibm.com>.
 So I see some benifit to this proposal.

Cautiously in favour of the proposal.

Andrae Muys

More information about the Python-list mailing list