I have released version 0.6 of my functional module, a collection of higher-order and functional programming tools for Python. Currently offered are tools for function composition, partial function application, plus flip, foldl, foldr, scanl and scanr functions.
Two version of the release are available: one is written in pure Python and aims for maximum readability and portability. The other is coded as a C extension module and is focused on raw performance.
Where to get it:
functional is available from the project's website at
and from the Python Package Index at
Both source tarballs and Python Eggs are available for both the pure Python and C releases. Eggs are available for Python versions 2.3, 2.4 and 2.5.
flip will now reverse all non-keyword arguments, as opposed to simply reversing the first two as it did in version 0.5 (by popular request).
functional.compose now comes with an optional unpack parameter to make up for the fact that Python functions aren't fully curried.
The unpack parameter means that you can now do something like this with compose:
i.e., automatically unpacking g's return value and passing the result to f.
To get this functionality, you'd write something like:
compose(f, g, unpack=True)(*args, **kwargs)
This was impossible with functional 0.5.
Weakref support has been added to flip and compose objects in the C version.
Sundry performance improvements for the C implementation.
As always, feedback welcome!