Why doesn't this simple Curry-like implemention work?

Paul Rubin phr-n2001d at nightsong.com
Sun Oct 28 08:23:35 CET 2001

"Michael R. Head" <burner at core.binghamton.edu> writes:

> # for some reason this function doesn't work in python 1.5.2.
> def curry(f, p):
> 	return lambda x: apply(f, p, x)
> I've looked up on the list better class-based implementations, and am
> using one of them, but I'm curious why this doesn't work (when the
> curried function is called, f becomes unknown). (I'm looking for a
> reason in the language spec). I'm supposing that lamda isn't storing
> the reference to its inputs -- which it seems it should -- is this
> correct?

I thought the third arg to apply was a keyword arg dictionary.
Is that really what you meant?

More information about the Python-list mailing list