PEP 312 - Making lambdas implicit worries me, surely it's just the name 'lambda' that is bad...

Bengt Richter bokr at
Sat Mar 15 17:59:21 CET 2003

On Tue, 11 Mar 2003 16:58:01 +0100, "Daniel Dittmar" <daniel.dittmar at> wrote:

>A. Lloyd Flanagan wrote:
>> Part of the problem, I think, is that people coming from other
>> languages don't understand the power and proper use of the lambda
>> construct.
>coming from Smalltalk:
>Python lambdas are restricted to one expression, which makes them cumbersome
>to use for more complex stuff and difficult to debug as you can't insert a
>quick 'print'.
Whatever the restrictions, you can arrange for "a quick print'," e.g.,

    def qp(x): print x; return x

or even

    def qp(fmt, x): print fmt % x; return x

I.e., use
in place of
to get "a quick 'print'" of an expression term.

Bengt Richter

More information about the Python-list mailing list