We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
npt._GenericAlias
1 parent 42f3203 commit 7c98e8cCopy full SHA for 7c98e8c
numpy/typing/tests/test_generic_alias.py
@@ -17,6 +17,10 @@
17
DType = _GenericAlias(np.dtype, (ScalarType,))
18
NDArray = _GenericAlias(np.ndarray, (Any, DType))
19
20
+# NOTE: The `npt._GenericAlias` *class* isn't quite stable on python >=3.11.
21
+# This is not a problem during runtime (as it's 3.8-exclusive), but we still
22
+# need it for the >=3.9 in order to verify its semantics match
23
+# `types.GenericAlias` replacement. xref numpy/numpy#21526
24
if sys.version_info >= (3, 9):
25
DType_ref = types.GenericAlias(np.dtype, (ScalarType,))
26
NDArray_ref = types.GenericAlias(np.ndarray, (Any, DType_ref))
0 commit comments