14 Feb
2021
14 Feb
'21
12:24 p.m.
11.02.21 13:24, J. Pic пише:
Lambdas can be defined as such:
w = lambda: [12] x = lambda y: len(y)
I'd like to propose the following:
w = (): [12] x = (y): len(y)
This syntax is ambiguous. if (y): len(y): What does the first colon mean? You cannot say until you read the second colon. It is difficult to parse for human and computer. While the current PEG parser perhaps can handle this, it still makes parsing slower and the code more errorprone. Lambda is a questionable feature at all. With support of comprehensions, local functions, the operator and functools modules there are not many use cases for lambda expression. They are supported, well, but it is not significant part of the language.