>> I don't see a need for the in-between crossbreed.
> 
> Cpdef is the ultimite crossbreed, and was very welcome. In fact, I  
> would say the whole point of Python/Cython is an in-between  
> crossbreed between C and Python. Or maybe I'm misinterpreting you here.

One final remark:

Don't get me wrong, I love cpdef!

The reason I don't mind cpdef is that it doesn't have any *interface* 
issues. In principle, any cpdef will guarantee a 1:1 match between the 
Python interface and C interface.

The NumPy ndarray object is written in C, outside of Cython control, and 
their contract with the users are in the Python interface, so the C 
struct is free to diverge as much or little as they like from the Python 
interface.

In principle, you cannot know anything about the C interface of such 
extension types.

I like to consider my NumPy project as an inlineable reimplementation of 
(a small subset of) the Python interface for speed purposes; it is in 
turn a *user* of the C interface. I think it is cleaner and will create 
less confusion and more readable numpy.pxd code if that layering is 
explicit.

Your approach will only work in-so-far as the C implementation lies very 
close to the Python interface. Which is true for NumPy (just a few 
renames needed), but not in principle.

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to