diff options
author | Josh Wilson <person142@users.noreply.github.com> | 2020-06-07 12:25:19 -0700 |
---|---|---|
committer | Josh Wilson <person142@users.noreply.github.com> | 2020-06-07 12:25:19 -0700 |
commit | 3fee17a0da9277ee21e20018beeb2a42ef12a02f (patch) | |
tree | 58ca04f7d6a7ab603d9d7327d488f0bf5986cf4a /numpy/tests/typing/fail/ndarray.py | |
parent | 11b95d15f10c2bc652ed19d5e27efa0384396cb8 (diff) | |
download | numpy-3fee17a0da9277ee21e20018beeb2a42ef12a02f.tar.gz |
MAINT: move typing tests cases into a subdirectory of numpy/tests
Diffstat (limited to 'numpy/tests/typing/fail/ndarray.py')
-rw-r--r-- | numpy/tests/typing/fail/ndarray.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/tests/typing/fail/ndarray.py b/numpy/tests/typing/fail/ndarray.py new file mode 100644 index 000000000..5a5130d40 --- /dev/null +++ b/numpy/tests/typing/fail/ndarray.py @@ -0,0 +1,11 @@ +import numpy as np + +# Ban setting dtype since mutating the type of the array in place +# makes having ndarray be generic over dtype impossible. Generally +# users should use `ndarray.view` in this situation anyway. See +# +# https://github.com/numpy/numpy-stubs/issues/7 +# +# for more context. +float_array = np.array([1.0]) +float_array.dtype = np.bool_ # E: Property "dtype" defined in "ndarray" is read-only |