From d7d6b6c8d067c5af02ca57f0646df77233021ea3 Mon Sep 17 00:00:00 2001 From: Francesc Alted Date: Fri, 4 May 2012 00:00:54 -0500 Subject: Stress that all array creation C functions steals a reference to descr. --- doc/source/reference/c-api.array.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 89981a977..8eedc689a 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -224,6 +224,8 @@ From scratch .. cfunction:: PyObject* PyArray_NewFromDescr(PyTypeObject* subtype, PyArray_Descr* descr, int nd, npy_intp* dims, npy_intp* strides, void* data, int flags, PyObject* obj) + This function steals a reference to *descr* if it is not NULL. + This is the main array creation function. Most new arrays are created with this flexible function. @@ -322,6 +324,8 @@ From scratch .. cfunction:: PyObject* PyArray_SimpleNewFromDescr(int nd, npy_intp* dims, PyArray_Descr* descr) + This function steals a reference to *descr* if it is not NULL. + Create a new array with the provided data-type descriptor, *descr* , of the shape deteremined by *nd* and *dims*. -- cgit v1.2.1