[Numpy-discussion] Access to C/C++, typemaps, pyrex...

Travis Oliphant oliphant.travis at ieee.org
Sun Mar 12 19:17:02 CST 2006

Andrew Straw wrote:
> What do you mean 'modern' cimport and .pxd statement?  I believe the
> example at http://scipy.org/Cookbook/Pyrex_and_NumPy is fundamentally no
> different than yours. One question, though: why have you reverted from
> using Python's Py_intptr_t and used intp instead? It seems to me much
> more likely that Py_intptr_t will be available and will do the Right
> Thing than relying on some libc to define it. We've seen broken
> implementations of C libraries before, and I say let's trust the Python
> devs to get this one right.
If you are including arrayobject.h, then intp is exactly Py_intptr_t.  
Since intp is what is used internally in numpy, why not use it in a 
numpy wrapper.

So, basically, I'm not sure what your point is.

I can see the case for the __array_struct__ interface which does not 
have to include arrayobject.h, then you need to use Py_intptr_t.


More information about the Numpy-discussion mailing list