[Python-ideas] pep 312 - implicit lambdas idea

Masklinn masklinn at masklinn.net
Sun Aug 9 16:40:15 CEST 2009


On 9 Aug 2009, at 13:03 , Gerald Britton wrote:
> Your proposal certainly would lead to ambiguity in reading:
> _ = myfunc
> if _:_(_:_, ...)
>
> The "if _:_" means:
>
>   if '_' evaluates to boolean true, call it
>
> The second _:_ uses your new lambda construct.  Could a compiler  
> parse it?
> Probably.  Can a human understand it? Maybe, with difficulty, but it  
> would
> surely lead to hard-to-find errors.

And from the point of view of someone who'd really like a "better  
lambda", the "implicit lambda" idea is pretty much worthless. As  
others have said, it saves a few keystrokes and that's pretty much it.

If work is done towards a better/more useable lambda, it should at  
least encompass full-blown anonymous expressions, not limit itself to  
the current restricted lambda.



More information about the Python-ideas mailing list