[issue13430] Add a curry function to the functools module
report at bugs.python.org
Fri Nov 18 18:03:05 CET 2011
Éric Araujo <merwok at netwok.org> added the comment:
To go back to your original message:
> I think it would be very usefull to add a curry function to the functools module.
For what use cases?
> Curried functions could be used as follow.
>>> adder(2, 3, 4)
>>> adder(2, 3)(4)
>>> adder(z = 4)(2, 3) # etc, etc, etc...
I don’t know the curry concept from other languages, but I’m experienced with Python and don’t like this idea at all. A function returns something; the returned value being callable or not is a property of that value, not of the function. The examples above look confusing to me.
I think you should discuss your use cases on the python-ideas mailing list.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list