Let's Talk About Lambda Functions!

Fredrik Lundh fredrik at pythonware.com
Mon Jul 29 11:51:08 EDT 2002


Tim Peters wrote:

> I don't think so -- Guido isn't a fan of functional programming styles, and
> plain doesn't like lambda.  Except, of course, when he uses it, which is
> always for trivial little function arguments, in accord with his
> oft-repeated claim that the functional gimmicks were never intended to be
> more than "minor conveniences" (which he later amended to "minor
> annoyances", after people started clamoring for more of the same).  It's not
> that they don't work exactly the same way in Python as some people expect
> them to

my memories of who said what and when is starting to get mixed
up, but I'm pretty sure I've seen and heard comments along those
lines over the years, including this c.l.py comment from 1996:

    Opinions on ugliness can vary, but personally, I just wish I'd never
    given in to the pressure to add lambda in the first place.  Nested
    functions are somewhat of an oddity, but once you say "lambda" you
    recall a whole complex of semantics for those who are used to it.

but I might be wrong.

> it's more that programming styles based on composition of higher-order functions
> simply aren't in his vision of what programming in Python should be.

that's true.  but that doesn't explain why did we added nested scopes
to 2.1?  did you guys just fail to stop Jeremy from checking them in, or
what happened?

> > to fix the other "mistake", some needs to come up with a
> > really great syntax (and get michael hudson to implement
> > it for them ;-).  ideas are welcome.

(I think that should have been "greg ewing needs to come up
with a really great syntax, and get michael hudson to implement
it"...  or maybe we could revive the old "frowning guido" design?)

> Well, I can channel that one:  not bloody likely.

oh, I don't know about that.  I definitely remember that the BDFL was
rather positive to the idea when we discussed this back at SPAM8 (or
whenever it was).  iirc, Eric Raymond volunteered to come up with a
"smalltalk block"-like design and a patch.  hasn't happened yet...

</F>





More information about the Python-list mailing list