summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-12-28 11:17:52 +0000
committerEric Wieser <wieser.eric@gmail.com>2019-05-11 15:03:24 -0700
commit599dbade766ad3fecc82afa308803a2e0082c149 (patch)
treee8076014281d30c3562834252050f9df5c5f1d26 /numpy/lib/tests/test_function_base.py
parent0f19dae081e6678902826b195e0d3857c5b4c2b3 (diff)
downloadnumpy-599dbade766ad3fecc82afa308803a2e0082c149.tar.gz
API: Make MaskedArray.mask return a view, rather than the underlying mask
This prevents consumers from reshaping the mask in place, which breaks things As a result, `x.mask is x.mask` returns `False`, but this was already true of `x.data is x.data`. May also be related to gh-10270
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 6d32c365a..0702c3856 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -945,7 +945,7 @@ class TestGradient(object):
assert_equal(type(out), type(x))
# And make sure that the output and input don't have aliased mask
# arrays
- assert_(x.mask is not out.mask)
+ assert_(x._mask is not out._mask)
# Also check that edge_order=2 doesn't alter the original mask
x2 = np.ma.arange(5)
x2[2] = np.ma.masked