Skip to content

Commit 7c98e8c

Browse files
author
Bas van Beek
committed
DOC: Add a note about npt._GenericAlias >=3.11 stability
1 parent 42f3203 commit 7c98e8c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

numpy/typing/tests/test_generic_alias.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
DType = _GenericAlias(np.dtype, (ScalarType,))
1818
NDArray = _GenericAlias(np.ndarray, (Any, DType))
1919

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
2024
if sys.version_info >= (3, 9):
2125
DType_ref = types.GenericAlias(np.dtype, (ScalarType,))
2226
NDArray_ref = types.GenericAlias(np.ndarray, (Any, DType_ref))

0 commit comments

Comments
 (0)