[SciPy-dev] Cython / python policy

Matthew Brett matthew.brett@gmail....
Fri Mar 6 15:30:54 CST 2009


Hi David, and team,

David, I've quoted you here on your response to an offer to submit
some code to your scikit, but as a jumping off point for further
discussion.

> There are only two big requirements:
>  - I do want a pure python implementation for everything (with
> optional C/Cython).

I was just thinking of doing some Cython.

Do we think that, in general, scipy code should have both C(ython)
_and_ python implementations of the same thing, with different names,
as for Anne's spatial package?

Or, in different namespaces (scipy.mypackage.c.func,
scipy.mypackage.python.func sort of thing)

Or, switched by a decorator (that depends on a conditional import), like this:

@replace_with('mycimplementation.func')
def func(a, b):
    return a+b # or something

(an idea from http://www.lfd.uci.edu/~gohlke/code/transformations.py.html).

To me, all these seem to add maintenance overhead without much gain.
We don't do that for C++ wrapping, after all...

Best,

Matthew


More information about the Scipy-dev mailing list