>
> Of course, the above can all be done in Python <3.0 using lambda,
> but functools.partial makes it look neater.
>
functools.partial is present in Python 2.5 or above.
> Regards
>
>
___
BangPypers mailing list
BangPypers@python.org
http://mail.
Anand Balachandran Pillai wrote:
> The new functools module in Python provides a neat
> API for doing function currying and doing some other
> FP tricks.
> Of course, the above can all be done in Python <3.0 using lambda,
> but functools.partial makes it look neater.
I haven't looked at Python
On Thu, Dec 11, 2008 at 12:09 PM, Anand Balachandran Pillai
<[EMAIL PROTECTED]> wrote:
>
> So, if you have a function which accepts four arguments, say
>
curry(curry(f, 10), 20)
>
curry(curry(curry(f, 10), 20), 30)
>
curry(curry(curry(curry(f, 10), 20), 30), 40)
>
def f(a,b,
The new functools module in Python provides a neat
API for doing function currying and doing some other
FP tricks.
The functools.partial function allows you to create
"partial" functions which chops off an argument from
the beginning of the argument list.
Simple example.
>>> def f(x,y): return x