[ANN] Partial.py: convenient notation for partial application/currying

Bryn Keller xoltar@xoltar.org
25 Jun 2003 13:33:26 -0700


By request, I'm releasing a draft of my partial.py module (available
from my Python page at http://www.xoltar.org/languages/python.html ),
which does things like this:

>>> from partial import _
>>> addWorld = _ + " world!"
>>> addWorld("Hello,")
"Hello, world"

>>> from functional import mapcall
>>> mapcall(_.upper, ["list", "of", "strings"])
["LIST", "OF", "STRINGS"]

>>> from operator import add
>>> add_one = add(1, _)
>>> add_one(5)
6
>>> map(add_one, [1,2,3])
[2,3,4]


This is a work in progress, use at your own risk. I do not expect the
interface to change at all but it is not widely tested and there may
very well be bugs. The module depends on updated versions of other
modules in the Xoltar Toolkit, so I'm releasing updated versions of
them as well. I'm not making a Sourceforge release because I haven't
had time to do the sort of testing I'd like to do before making a
release. At least this way, you can try them out. If you find bugs,
please report them and I'll fix them (though sometimes slowly).

Bryn

xoltar at xoltar dot org