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

François Pinard pinard at iro.umontreal.ca
Mon Aug 5 09:10:28 EDT 2002

[John Roth]

> "François Pinard" <pinard at iro.umontreal.ca> wrote in message

> > If the rationale is essentially reduced to the vague statement of a
> > "continuous interest", it is a pretty weak rationale.

> "Continuous interest" is hardly vague.  All one has to do is look up the
> subject on google groups, and you'll find it popping up with remarkable
> frequency.

There has been a "continuous interest" about using braces or brace-like
delimiters in Python instead of indentation, as Google and various c.l.py
archives would undoubtedly show you.  And yet, it is unlikely that Python
abandons indentation in favour of braces: because "continuous interest"
is far from being any kind of strong rationale.  We would need something
much more substantial, detailed and circumstantiated; that is, focus points
covering most aspect of debates and discussions.

> As far as arguing the case, people who want it need to do that.

What is this famous Larry Wall quote?  He concedes that Python is nicer
than Perl, but says that "Users wanted Perl this way".

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.

[1] I say to my friends that the main job and torture of programming is
choosing good identifier names.  Once all identifiers has been well thought
and chosen in any project, there is very, very little left to do! :-)

François Pinard   http://www.iro.umontreal.ca/~pinard

More information about the Python-list mailing list