PEP309 - built-in curry class (revisions)

Terry Reedy tjreedy at udel.edu
Fri Feb 28 08:35:40 EST 2003


"Peter Harris" <scav at blueyonder.co.uk> wrote in message
news:78f45bd8.0302280212.76bb9d62 at posting.google.com...
> Carl Banks <imbosol-1046365979 at aerojockey.com> wrote in message
news:<18s7a.35798$ep5.10090 at nwrddc02.gnilink.net>...
> > I assume this module would be written in C?  Then there's not much
> > point in having a separate curry as a nested function.  The nested
> > function curry's main advantage over the Python class form is that
> > it's easier to write, more straightforward (to me) to read, and
> > faster.  The first two advantages won't matter in a standard
module,
> > and a class written in C will be faster than the closure.
> >
>
> Well, not everything in the standard library is implemented in C. I
> can see the performance argument, but on the other hand there is
also
> the benefit of everyone being able to see the source.

If anything, the trend is *away* from C-coding modules - certainly for
first implementation (as with sets).  There is some thought that some
things should be lifted from C back to Python.  PyPy is just an
extreme example.  I think C should be reserved for inner-loop stuff.
I don't see that currying qualifies.

In anycase, distribution as a third-party module is much easier as
Python than C code.

Terry J. Reedy






More information about the Python-list mailing list