Re:Stop writing lambda expressions in Python
by eesmith on Thursday September 27, 2018 @06:32PM
(#18089424)
Van Rossum in https://python-history.blogspot.com/2009/04/origins-of-pytho... comments that "lambda" was likely the wrong choice for a name, saying "the choice of terminology had many unintended consequences. For instance, users familiar with functional languages expected the semantics of lambda to match that of other languages. As a result, they found Python’s implementation to be sorely lacking in advanced features."
Perhaps it would help if you didn't think of "lambda" as defining a lambda function, but something more prosaic like "defexpr", and that Python doesn't have lambda functions at all?
As to your experiments, you have found one of the many differences between Python 2 and Python 3.
After researching F# for about 10 minutes, perhaps you might think of Python 2 as being like OCaml and Python 3 being like F# - they are two instances of the same language family, with a mutually compatible language subset, but many incompatibilities.
Perhaps it would help if you didn't think of "lambda" as defining a lambda function, but something more prosaic like "defexpr", and that Python doesn't have lambda functions at all?
As to your experiments, you have found one of the many differences between Python 2 and Python 3.
After researching F# for about 10 minutes, perhaps you might think of Python 2 as being like OCaml and Python 3 being like F# - they are two instances of the same language family, with a mutually compatible language subset, but many incompatibilities.