diff options
author | Meet Udeshi <mudeshi1209@gmail.com> | 2016-02-23 02:55:39 +0530 |
---|---|---|
committer | Meet Udeshi <mudeshi1209@gmail.com> | 2016-02-23 02:55:39 +0530 |
commit | 141d3a954b955b7f0821574e03b693ec4078640b (patch) | |
tree | 45a07026ee81bb34a5c7f6db9cf9795f0d5ac24a /numpy/tests | |
parent | fa3cde1b44182297663c69daa41abb576218a2ab (diff) | |
download | numpy-141d3a954b955b7f0821574e03b693ec4078640b.tar.gz |
[PATCH] Make _pointer_type_cache functional
Fix #2303
Cache queries wont miss because the whole tuple is cached as key
and not just dtype
Adapted from patch submitted by Colin Hogben
Diffstat (limited to 'numpy/tests')
-rw-r--r-- | numpy/tests/test_ctypeslib.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/tests/test_ctypeslib.py b/numpy/tests/test_ctypeslib.py index 5e888eb65..36274ad46 100644 --- a/numpy/tests/test_ctypeslib.py +++ b/numpy/tests/test_ctypeslib.py @@ -101,6 +101,11 @@ class TestNdpointer(TestCase): self.assertTrue(p.from_param(x)) self.assertRaises(TypeError, p.from_param, np.array([[1, 2], [3, 4]])) + def test_cache(self): + a1 = ndpointer(dtype=np.float64) + a2 = ndpointer(dtype=np.float64) + self.assertEqual(a1, a2) + if __name__ == "__main__": run_module_suite() |