From 515c3416e0480b6219d6b8737642c3b27d7157f4 Mon Sep 17 00:00:00 2001 From: Bas van Beek Date: Fri, 15 Jan 2021 18:59:36 +0100 Subject: TST: Added a tests for `number` invariancy --- numpy/typing/tests/data/fail/scalars.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.1