PEP309 - built-in curry class (revisions)

Peter Harris scav at blueyonder.co.uk
Thu Feb 27 10:02:24 EST 2003


Before I upload another (less drastically ambitious) version of
PEP 309, I want to thrash out a few things.

Several people have said curry() belongs in the standard library
rather than as a built-in. If so, what should the module name be,
and what sort of other things might the module contain?

The PEP is for a built-in of course, but I would be delighted
with inclusion in the standard library too, so I would like to
make a constructive proposal for it.
 
How about the following?

    Module to be called "functional" (it can be a home for
    operations on higher-order functions in general.)

    functional.curry() as a nested function.

    functional.Curry as a class, so those who want the
        introspection and sub-classing can have it.

An example of something else that might hypothetically belong in
"functional" is compose(f,g) ==> (g(f(*args, **kw)).

Although I have never seen an example where a compose is the
clearest and nicest way to get something done (and it's not part of
the PEP), if someone wants it in the future then "compose()" might
as well go in the same module as curry().

Another thought: would a suitable reduced PEP 309, only asking for a
standard library module of about 20 lines of code stand ANY chance
of making 2.3?  I must be a masochist asking a question like that,
but what the hell...

Peter




More information about the Python-list mailing list