Function currying extension module

Harry George hgg9140 at seanet.com
Tue Feb 18 19:48:26 EST 2003


Carl Banks <imbosol-1045609459 at aerojockey.com> writes:

> Inspired by PEP 309 (yet very different from it), I wrote a C
> extension class to perform function currying.  I'm hoping this could
> evolve into part of a module "functional" to appear in Python 2.4.
> 
> Basic usage is g = curry(f,__,arg,__), whence g(1,2) results in f
> being called as f(1,arg,2).  curryleft and curryright also exist.
> 
> Below are two python files, currytest.py and currydemo.py, followed by
> the source to the extension module, curry.c.  For me, currytest
> indicates that a simple lambda is still a little faster than the
> curry.
> 
> Opinion, comments, suggestions on how to make it faster?  It appears
> that the bottleneck is allocating a tuple, which not much can be done
> about.
> 
> 
Any relation to xoltar?
http://www.xoltar.org/languages/python.html

[snip]
> CARL BANKS




More information about the Python-list mailing list