Whey you need a simple function in Python, there is a choice between a normal function declaration and an assignment of a anonymous function (defined by a lambda-expression) to a variable:

   def f(x): return x*x

or

   f = lambda x: x*x

It would be however more convenient to be able to write instead just

   f(x) = x*x

(like in Haskell and such).

Have this idea been discussed before?

I do not see any conflicts with the existing syntax. The following would also work:

   incrementer(m)(n) = n + m

instead of

   incrementer = lambda m: lambda n: n + m

Alexey.


--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to