Let's Talk About Lambda Functions!

Alex Martelli aleax at aleax.it
Fri Jul 26 15:26:21 EDT 2002


Britt A. Green wrote:

> So I know what lambda functions are, they're syntax and how they're used.
> However I'm not sure *why* one would use a lambda function. What's the

No idea, really.  Maybe something to do with shocks in one's childhood.

> advantage that they offer over a regular function?

Well, they do look more mysterious and arcane, and therefore, maybe,
make their proponents believe they're k00l.  With a lambda you can
keep a function anonymous, which must have something of the same
attraction as writing anonymous letters.  You can also squish a lot
of them together in weird ways to take advantage of the fact that
a lambda form is an expression.  k00l, innit?

Normal functions are clear, simple, understandable, and regular,
therefore intolerably middle-class, ordinary, bourgeois, mundane.

And they can take up a WHOLE extra line, or *more*!!!, which is
obviously appalling waste of, well, of something or other, for sure.


Alex




More information about the Python-list mailing list