From 5b636c4e22014622f3e85b4630153c110444d3cd Mon Sep 17 00:00:00 2001 From: mattip Date: Wed, 6 Dec 2017 21:20:13 +0200 Subject: return values --- doc/source/reference/c-api.array.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'doc/source/reference/c-api.array.rst') 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 ^^^^^^^^^^^^^^^^^ -- cgit v1.2.1