diff options
author | Jaime Fernandez <jaime.frio@gmail.com> | 2015-08-13 22:07:18 -0700 |
---|---|---|
committer | Jaime Fernandez <jaime.frio@gmail.com> | 2015-08-16 23:09:57 -0700 |
commit | 649ede494a069fc97ed4f0110f86cdb0707ae1ce (patch) | |
tree | dccd7e0e901308e2746715246b173345d7529762 /numpy/lib/tests/test_function_base.py | |
parent | ed9a0f347a4cb273edf0b8b5dcc98de57b8158cf (diff) | |
download | numpy-649ede494a069fc97ed4f0110f86cdb0707ae1ce.tar.gz |
MANT: searchsorted should return base ndarrays always
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index b29012bcb..c8e2c2128 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -913,6 +913,15 @@ class TestDigitize(TestCase): x, bins = bins, x assert_raises(TypeError, digitize, x, bins) + def test_return_type(self): + # Functions returning indices should always return base ndarrays + class A(np.ndarray): + pass + a = np.arange(5).view(A) + b = np.arange(1, 3).view(A) + assert_(not isinstance(digitize(b, a, False), A)) + assert_(not isinstance(digitize(b, a, True), A)) + class TestUnwrap(TestCase): |