And as a short bonus, I also disagree with your FAQ section “Why not extend lambda to support type hints?”
If you desire to have something like this:
f = lambda (x: int, y: int): x + y
PEP 3113 removes Tuple Parameter Unpacking is one of the strongest reason:
No, quite the opposite: Since PEP 3113 removed Tuple Parameter Unpacking, one could now reuse that Python 2 syntax to allow lambda expression parameters to be parenthesized.
And if you desire to have something like this (no space between
lambdaand():
a = lambda(x: int, y: int): x + y
This would allow lambda to have two ways (lambda(x):vslambda x:) to do the same thing, which violates the Zen of Python: There should be one-- and preferably only one --obvious way to do it.
- Space or no space. There is no difference.
- The Zen of Python does not say that there must not be more than one way to do it. And, anyway,
lamdefwould be a second way as well…