diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-01-15 18:59:36 +0100 |
---|---|---|
committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-01-19 17:05:42 +0100 |
commit | 515c3416e0480b6219d6b8737642c3b27d7157f4 (patch) | |
tree | ca77d13bbc91c9aa2a0d6c83a641bdc67dc2fb8c | |
parent | db018a5d52b9773107325a8221a88eea0cbd79aa (diff) | |
download | numpy-515c3416e0480b6219d6b8737642c3b27d7157f4.tar.gz |
TST: Added a tests for `number` invariancy
-rw-r--r-- | numpy/typing/tests/data/fail/scalars.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/typing/tests/data/fail/scalars.py b/numpy/typing/tests/data/fail/scalars.py index f09740875..0aeff398f 100644 --- a/numpy/typing/tests/data/fail/scalars.py +++ b/numpy/typing/tests/data/fail/scalars.py @@ -1,5 +1,6 @@ import numpy as np +f2: np.float16 f8: np.float64 # Construction @@ -74,3 +75,8 @@ f8.item((0, 1)) # E: incompatible type f8.squeeze(axis=1) # E: incompatible type f8.squeeze(axis=(0, 1)) # E: incompatible type f8.transpose(1) # E: incompatible type + +def func(a: np.float32) -> None: ... + +func(f2) # E: incompatible type +func(f8) # E: incompatible type |