Sturla Molden wrote:

> Neal Becker skrev:
>> Do any of these suggestions address my problem with array base?
>>
>>     ctypedef class numpy.ndarray [object PyArrayObject]:
>>         cdef __cythonbufferdefaults__ = {"mode": "strided"}
>>         
>>         cdef:
>>             # Only taking a few of the most commonly used and stable
>>             # fields. One should use PyArray_* macros instead to access
>>             # the C
>> fields.
>>             char *data
>>             int ndim "nd"
>>             npy_intp *shape "dimensions"
>>             npy_intp *strides
>>             dtype descr
>>             object base  <<< my addition
>>
>> Problem was that base could be NULL, and attempting to assign to it would
>> try to call DECREF, and BOOM.
>>  
> You have to use Py_XDECREF and Py_XINCREF instead of Py_DECREF and
> Py_INCREF.
> 
> S.M.

I didn't use either one.  Cython used Py_DECREF automatically, because 
'base' was and 'object'.

_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to