Skip to content

Commit fcbef51

Browse files
committed
🧪 add (failing) numpy integration test for HasArrayNamespace
1 parent 2619e7f commit fcbef51

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎tests/integration/test_numpy.pyi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)