From 86608c2883b9f1db468bf6d3b6d2a82a72f48b0f Mon Sep 17 00:00:00 2001 From: mattip Date: Sun, 22 Apr 2018 01:42:29 +0300 Subject: DOC: cleanup documentation, continuation of nditer PR #9998 --- doc/source/reference/c-api.iterator.rst | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'doc/source/reference/c-api.iterator.rst') diff --git a/doc/source/reference/c-api.iterator.rst b/doc/source/reference/c-api.iterator.rst index 314b62a16..6a9ec6005 100644 --- a/doc/source/reference/c-api.iterator.rst +++ b/doc/source/reference/c-api.iterator.rst @@ -709,6 +709,10 @@ Construction and Destruction the functions will pass back errors through it instead of setting a Python exception. + :c:func:`NpyIter_Deallocate` must be called for each copy. One call to + :c:func:`NpyIter_Close` is sufficient to trigger writeback resolution for + all copies since they share buffers. + .. c:function:: int NpyIter_RemoveAxis(NpyIter* iter, int axis)`` Removes an axis from iteration. This requires that @@ -761,8 +765,10 @@ Construction and Destruction .. c:function:: int NpyIter_Close(NpyIter* iter) - Resolves any needed writeback resolution. Must be called before - ``NpyIter_Deallocate``. After this call it is not safe to use the operands. + Resolves any needed writeback resolution. Should be called before + :c:func::`NpyIter_Deallocate`. After this call it is not safe to use the operands. + When using :c:func:`NpyIter_Copy`, only one call to :c:func:`NpyIter_Close` + is sufficient to resolve any writebacks, since the copies share buffers. Returns ``0`` or ``-1`` if unsuccessful. @@ -770,10 +776,10 @@ Construction and Destruction Deallocates the iterator object. - `NpyIter_Close` should be called before this. If not, and if writeback is - needed, it will be performed at this point in order to maintain + :c:func:`NpyIter_Close` should be called before this. If not, and if + writeback is needed, it will be performed at this point in order to maintain backward-compatibility with older code, and a deprecation warning will be - emmitted. Old code shuold be updated to call `NpyIter_Close` beforehand. + emmitted. Old code should be updated to call `NpyIter_Close` beforehand. Returns ``NPY_SUCCEED`` or ``NPY_FAIL``. -- cgit v1.2.1