Let's Talk About Lambda Functions!

Bryan Olson fakeaddress at nowhere.org
Sun Jul 28 02:33:47 EDT 2002


Alex Martelli wrote:
 > Steve Holden wrote:
Alex Martelli had written:
 >>>The poster is typically nonplusses that all buttons print 'fum'.
 >>>
 >>
 >>I would be nonplussed if that code even *compiled*, given that "print" is
 >>a keyword and lambda takes an expression not a statement.
 >
 >
 > Right - you caught my little trap.  I don't regret using it, though,
 > because it DID catch a couple of lambda-lovers...

First, who do you think you're kidding?  It was your mistake not
your trap.  Second, this question is better answered by people who
actually understand use of lambda.

[...]
 > I think the reason why Guido suggests it's a wart is that it IS a wart.
 >
 > Sure, backwards compatibility mandates lambda stay, but I think it's
 > worth emphasizing that it's there ONLY for backwards compatibility,
 > and using def is better.

The mistake was limiting lambda to expressions.


--Bryan




More information about the Python-list mailing list