Message147901
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(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. |
|
Date |
User |
Action |
Args |
2011-11-18 17:03:05 | eric.araujo | set | recipients:
+ eric.araujo, collinwinter, rhettinger, pitrou, gregory_p, ezio.melotti, alex, serprex, markonervo |
2011-11-18 17:03:05 | eric.araujo | set | messageid: <1321635785.16.0.616079076639.issue13430@psf.upfronthosting.co.za> |
2011-11-18 17:03:04 | eric.araujo | link | issue13430 messages |
2011-11-18 17:03:04 | eric.araujo | create | |
|