summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2018-04-21 22:56:55 +0300
committermattip <matti.picus@gmail.com>2018-04-21 22:56:55 +0300
commitfa9a74165479142e2c1671f871fe7c860146cd52 (patch)
tree1cc11347143043da7beac90cea9249ea34387c2a /numpy/add_newdocs.py
parentc26d273c1204d75fe5ab2ce9591e1b0b0b0880e1 (diff)
downloadnumpy-fa9a74165479142e2c1671f871fe7c860146cd52.tar.gz
fixes from review
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r--numpy/add_newdocs.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index a48b76a8d..c2d2c0949 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -392,10 +392,11 @@ add_newdoc('numpy.core', 'nditer',
... [['writeonly', 'updateifcopy']],
... casting='unsafe',
... op_dtypes=[np.dtype('f4')]) as i:
- ... i.operands[0][:] = [-1, -2, -3]
+ ... x = i.operands[0]
+ ... x[:] = [-1, -2, -3]
... # a still unchanged here
- >>> a
- array([-1, -2, -3])
+ >>> a, x
+ array([-1, -2, -3]), array([-1, -2, -3])
It is important to note that once the iterator is exited, dangling
references (like `x` in the example) may or may not share data with