[Numpy-discussion] C API refcount question
Charles R Harris
charlesr.harris@gmail....
Mon Jul 6 09:35:32 CDT 2009
On Mon, Jul 6, 2009 at 7:30 AM, Dag Sverre Seljebotn <
dagss@student.matnat.uio.no> wrote:
> I'm trying to fledge out Cython's numpy.pxd, and have a question:
>
> Is there documentation anywhere, or a simple-to-remember rule, on
> whether the return value of a NumPy C API is incref-ed or not?
>
> E.g. PyArray_BASE, PyArray_DESCR obviously does not incref; while I'm
> assuming that PyArray_New* must incref for successful operation.
> Furthermore PyArray_GETITEM must also incref.
>
> This kind of a priori guessing and source inspection gets tiresome for
> the hundreds of functions I must cover though...
>
Heh, I can't answer that question. I suppose we should figure it out and
document it some day ;) Does Travis' book say anything?
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090706/0997a022/attachment.html
More information about the NumPy-Discussion
mailing list