
Hi, Pyrex 0.9.5.1 doesn't like the following snippet out of c_numpyx.pyx: ctypedef extern class numpy.broadcast [object PyArrayMultiIterObject]: cdef int numiter cdef npy_intp size, index cdef int nd cdef npy_intp dimensions[NPY_MAXDIMS] cdef flatiter iters[NPY_MAXDIMS] which corresponds to typedef struct { PyObject_HEAD int numiter; /* number of iters */ npy_intp size; /* broadcasted size */ npy_intp index; /* current index */ int nd; /* number of dims */ npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */ PyArrayIterObject *iters[NPY_MAXARGS]; /* iterators */ } PyArrayMultiIterObject; in ndarrayobject.h. I changed it to be ctypedef extern class numpy.broadcast [object PyArrayMultiIterObject]: cdef int numiter cdef npy_intp size, index cdef int nd cdef npy_intp *dimensions cdef flatiter **iters after which it complains /tmp/pyrex/c_numpy.pxd:99:22: Pointer base type cannot be a Python object so I changed the last line to cdef flatiter iters That compiles, but it can't be right. Any advice/suggestions? Cheers Stéfan

Stefan van der Walt wrote:
Any advice/suggestions?
I've just committed a fix. I changed the [NPY_MAXDIMS] arrays to pointers (Pyrex doesn't care, really) and changed the flatiter *items to void **items. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (2)
-
Robert Kern
-
Stefan van der Walt