|
|
|
|
|
by neuland
3435 days ago
|
|
Interesting. It's clear to me. It looks a lot people who had some confusion with the scope of x in something like ... f(x) = x^2 + 1
would also have problems quickly seeing the scope of x in lambdas that are present in a bunch of modern programing languages like python. f = lambda x: x^2 + 1
It seems python lambdas also don't support type hinting like you mention was a problem in Fortran, too. |
|
As for type hinting, Python 3 does support it: https://docs.python.org/3/library/typing.html but I think the better lesson to learn is that it can be hard to future-proof alternative syntax or syntactic sugar. I looked at the 3.X docs, and PEP 484 and 526, no mention of how this typing can work with lambdas, and no comment that it doesn't (!)