summaryrefslogtreecommitdiff
path: root/numpy/typing
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/typing')
-rw-r--r--numpy/typing/tests/data/fail/scalars.pyi5
-rw-r--r--numpy/typing/tests/data/pass/scalars.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/numpy/typing/tests/data/fail/scalars.pyi b/numpy/typing/tests/data/fail/scalars.pyi
index c24f9e479..2a6c2c7ad 100644
--- a/numpy/typing/tests/data/fail/scalars.pyi
+++ b/numpy/typing/tests/data/fail/scalars.pyi
@@ -47,7 +47,8 @@ np.uint16(A()) # E: incompatible type
np.uint32(A()) # E: incompatible type
np.uint64(A()) # E: incompatible type
-np.void("test") # E: incompatible type
+np.void("test") # E: No overload variant
+np.void("test", dtype=None) # E: No overload variant
np.generic(1) # E: Cannot instantiate abstract class
np.number(1) # E: Cannot instantiate abstract class
@@ -62,7 +63,7 @@ np.uint64(value=0) # E: Unexpected keyword argument
np.complex128(value=0.0j) # E: Unexpected keyword argument
np.str_(value='bob') # E: No overload variant
np.bytes_(value=b'test') # E: No overload variant
-np.void(value=b'test') # E: Unexpected keyword argument
+np.void(value=b'test') # E: No overload variant
np.bool_(value=True) # E: Unexpected keyword argument
np.datetime64(value="2019") # E: No overload variant
np.timedelta64(value=0) # E: Unexpected keyword argument
diff --git a/numpy/typing/tests/data/pass/scalars.py b/numpy/typing/tests/data/pass/scalars.py
index 124681bcb..a5c6f96e9 100644
--- a/numpy/typing/tests/data/pass/scalars.py
+++ b/numpy/typing/tests/data/pass/scalars.py
@@ -113,6 +113,8 @@ np.void(True)
np.void(np.bool_(True))
np.void(b"test")
np.void(np.bytes_("test"))
+np.void(object(), [("a", "O"), ("b", "O")])
+np.void(object(), dtype=[("a", "O"), ("b", "O")])
# Protocols
i8 = np.int64()