diff options
author | mattip <matti.picus@gmail.com> | 2017-12-06 21:20:13 +0200 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2017-12-06 21:20:13 +0200 |
commit | 5b636c4e22014622f3e85b4630153c110444d3cd (patch) | |
tree | 913a0405de10af2b7dc3bcefd51952baefef967b /doc/source/reference/c-api.array.rst | |
parent | 1ab78a554bb8e368282047bad82326ce1fa4ecb7 (diff) | |
download | numpy-5b636c4e22014622f3e85b4630153c110444d3cd.tar.gz |
return values
Diffstat (limited to 'doc/source/reference/c-api.array.rst')
-rw-r--r-- | doc/source/reference/c-api.array.rst | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 155f1c3e5..82cac676e 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -1354,6 +1354,8 @@ Special functions for NPY_OBJECT that when ``arr`` is destructed, it will copy any changes back to ``base``. DEPRECATED, use :c:func:`PyArray_SetWritebackIfCopyBase``. + Returns 0 for success, -1 for failure. + .. c:function:: int PyArray_SetWritebackIfCopyBase(PyArrayObject* arr, PyArrayObject* base) Precondition: ``arr`` is a copy of ``base`` (though possibly with different @@ -1363,6 +1365,8 @@ Special functions for NPY_OBJECT `Py_DECREF`` in order copy any changes back to ``base`` and reset the READONLY flag. + Returns 0 for success, -1 for failure. + Array flags ----------- @@ -3252,7 +3256,7 @@ Memory management :c:data:`NPY_USE_PYMEM` is 0, if :c:data:`NPY_USE_PYMEM` is 1, then the Python memory allocator is used. -.. c:function:: PyArray_ResolveWritebackIfCopy(PyArrayObject* obj) +.. c:function:: int PyArray_ResolveWritebackIfCopy(PyArrayObject* obj) If ``obj.flags`` has :c:data:`NPY_ARRAY_WRITEBACKIFCOPY` or (deprecated) :c:data:`NPY_ARRAY_UPDATEIFCOPY`, this function copies ``obj->data`` to @@ -3260,7 +3264,9 @@ Memory management writeable, and sets ``obj->base`` to NULL. This is the opposite of :c:func:`PyArray_SetWritebackIfCopyBase`. Usually this is called once you are finished with ``obj``, just before ``Py_DECREF(obj)``. It may be called - multiple times, or with ``NULL`` input. + multiple times, or with ``NULL`` input. + + Returns 0 if nothing was done, -1 on error, and 1 if action was taken. Threading support ^^^^^^^^^^^^^^^^^ |