summaryrefslogtreecommitdiff
path: root/numpy/core/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-07-06 10:43:41 -0600
committerCharles Harris <charlesr.harris@gmail.com>2014-07-06 10:43:41 -0600
commit94417e42ee604b22e91e8af627270d4a106d09ee (patch)
tree2b08de10addcb1664c618d7522e2dd4dbb4b0097 /numpy/core/tests
parent8dba040fcc26c21c982d162b03948a0b21b65535 (diff)
parent77d62bb551c1bfb4d475fa932b718660b6deadbd (diff)
downloadnumpy-94417e42ee604b22e91e8af627270d4a106d09ee.tar.gz
Merge pull request #4843 from juliantaylor/subclass-writeable
BUG: retain writeable flag when indexing subclasses
Diffstat (limited to 'numpy/core/tests')
-rw-r--r--numpy/core/tests/test_indexing.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/core/tests/test_indexing.py b/numpy/core/tests/test_indexing.py
index 44928b264..2dfaf6f3c 100644
--- a/numpy/core/tests/test_indexing.py
+++ b/numpy/core/tests/test_indexing.py
@@ -285,6 +285,17 @@ class TestIndexing(TestCase):
assert_((a == 1).all())
+ def test_subclass_writeable(self):
+ d = np.rec.array([('NGC1001', 11), ('NGC1002', 1.), ('NGC1003', 1.)],
+ dtype=[('target', 'S20'), ('V_mag', '>f4')])
+ ind = np.array([False, True, True], dtype=bool)
+ assert_(d[ind].flags.writeable)
+ ind = np.array([0, 1])
+ assert_(d[ind].flags.writeable)
+ assert_(d[...].flags.writeable)
+ assert_(d[0].flags.writeable)
+
+
def test_memory_order(self):
# This is not necessary to preserve. Memory layouts for
# more complex indices are not as simple.