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

John Roth johnroth at ameritech.net
Mon Aug 5 14:04:33 CEST 2002


"François Pinard" <pinard at iro.umontreal.ca> wrote in message
news:mailman.1028514788.29672.python-list at python.org...
> [John Roth]
>
> > Rationale
>
> >     There is a continuous interest in generalizing the lambda()
function,
> >     which has significant limitations.  Most of the proposals to
date
> >     have attempted to invent additional syntax to allow fewer
restrictions
> >     while still maintaining the expression format of lambda().
>
> The rumour states that Guido regrets having added `lambda' to Python.
> I guess it goes beyond the mere `lambda' keyword: it is reasonable to
> think that what Guido regrets is the addition of anonymous functions.

I'll have to admit that my memory of Guido's statements about
lambda is pretty foggy, so I'm not going to argue this, although I
don't believe it's true.

> If the rationale is essentially reduced to the vague statement of a
> "continuous interest", it is a pretty weak rationale.  Before anything
> else, the rationale should stress, in very convincing ways, why
anonymous
> functions should grow stronger in Python, instead of being faded out.

"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.

As far as arguing the case, people who want it need to do that.
>From my perspective, it's a stylistic issue. Some people like to
encapsulate one time things at the point they're used, and some
people like to extract them and give them names. If I'm wearing
my XP hat, I'd go with the latter POV - it simplifies writing tests.

On the other hand, there's a great deal of validity in the POV that
says you've got the function in front of you, so you know what it
does, and you don't have to go looking all over for it.

> Also, recent additions in Python are said to significantly alleviate
most
> of the need for anonymous functions, so the rationale of this PEP
might
> explain why these additions are still not satisfactory on that
respect.

Which additions?

John Roth






More information about the Python-list mailing list