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

Tim Peters tim.one at comcast.net
Mon Aug 5 05:28:59 CEST 2002


[François Pinard]
> 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.

It's more than a rumor, but is open to Interpretation (I guess ...).  At the
end of the "lightning talks" at OSCON last month, Guido gave a brief talk on
"Python Regrets".  The slides are here:

    <http://www.python.org/doc/essays/ppt/regrets/PythonRegrets.pdf>

The fourth slide begins:

"""
                      Lambda and functional stuff

• I've never liked lambda
  – crippled (only one expression)
  – confusing (no argument list parentheses)
  – can use a local function instead
"""

I suppose you can read that as saying he thought lamba was a peachy idea
that just didn't go far *enough*, but that stretches credulity for me.
Whenever these come up, lambda gets lumped in with "functional stuff",
meaning the filter/map/reduce functions that went in with the same patch
that implemented lambda (and regrets about which fill the remainder of this
slide).

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

I'm staying out of this round, except <wink> to note that the only example
in the PEP:

        x = (
            def (x, y):
                print x
                print y
            )

would be clearer written:

        def x(x, y):
            print x
            print y

People slinging GUI callbacks for a living could surely contribute more
compelling examples.






More information about the Python-list mailing list