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.
HasArrayNamespace
1 parent 2619e7f commit fcbef51Copy full SHA for fcbef51
‎tests/integration/test_numpy.pyi‎
@@ -0,0 +1,15 @@
1
+from typing import Any, TypeVar
2
+
3
+import numpy.typing as npt
4
5
+import array_api_typing as xpt
6
7
+_T = TypeVar("_T", bound=npt.NDArray[Any])
8
9
+def get_namespace(obj: xpt.HasArrayNamespace[_T], /) -> _T: ...
10
11
+###
12
+# Ensure that `np.ndarray` instances are assignable to `xpt.HasArrayNamespace`.
13
14
+arr: npt.NDArray[Any]
15
+arr_namespace: xpt.HasArrayNamespace[Any] = arr
0 commit comments