[Python-3000] Requiring () around lambda's argument list

Delaney, Timothy (Tim) tdelaney at avaya.com
Wed May 3 00:34:29 CEST 2006


Guido van Rossum wrote:

>> Thomas Wouters writes:
>>> Lambda-lovers will probably jump all over me for suggesting
>>> this, and I doubt you'll go fir it, but what about just not
>>> allowing type annotations in lambda statements? They're
>>> neutered anyway.

[snip Michael Chermside ;)]

> Fine with me -- this is in fact the solution I was going to prototype.
> But in the long run I expect the difference is going to grate.
> Later...

About the only time I use lambda is (as Michael said) for tiny anonymous
functions that are going to be used immediately. Generally I don't care
what the types of the arguments are - the types of the lambda arguments
should be whatever is passed into them. I'm sure as hell not going to do
any validation in the lambda!

So I'd definitely be +1 on not allowing type annotations on lambda.

Tim Delaney


More information about the Python-3000 mailing list