diff options
author | mattip <matti.picus@gmail.com> | 2018-04-20 13:11:32 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2018-04-20 13:11:32 +0300 |
commit | c26d273c1204d75fe5ab2ce9591e1b0b0b0880e1 (patch) | |
tree | d6fe1169553146618706c6fbce7c9eae193e384c /doc/source | |
parent | 894dcab37ea2df285c6f48eb9b019a528b803cb5 (diff) | |
download | numpy-c26d273c1204d75fe5ab2ce9591e1b0b0b0880e1.tar.gz |
ENH: add nditer.close as per review
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/reference/arrays.nditer.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/source/reference/arrays.nditer.rst b/doc/source/reference/arrays.nditer.rst index 710ad8be6..911ff6671 100644 --- a/doc/source/reference/arrays.nditer.rst +++ b/doc/source/reference/arrays.nditer.rst @@ -85,9 +85,12 @@ By default, the :class:`nditer` treats the input array as a read-only object. To modify the array elements, you must specify either read-write or write-only mode. This is controlled with per-operand flags. The operands may be created as views into the original data with the -`WRITEBACKIFCOPY` flag. In this case the iterator must be used as a context -manager, and the temporary data will be written back to the original array -when the `__exit__` function is called. +`WRITEBACKIFCOPY` flag. In this case the iterator must either + +- be used as a context manager, and the temporary data will be written back + to the original array when the `__exit__` function is called. +- have a call to the iterator's `close` function to ensure the modified data + is written back to the original array. Regular assignment in Python simply changes a reference in the local or global variable dictionary instead of modifying an existing variable in |