diff options
Diffstat (limited to 'numpy/_array_api')
| -rw-r--r-- | numpy/_array_api/_array_object.py | 4 | ||||
| -rw-r--r-- | numpy/_array_api/_data_type_functions.py | 4 | ||||
| -rw-r--r-- | numpy/_array_api/_manipulation_functions.py | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/numpy/_array_api/_array_object.py b/numpy/_array_api/_array_object.py index 4b11a0ca0..ad0cbc71e 100644 --- a/numpy/_array_api/_array_object.py +++ b/numpy/_array_api/_array_object.py @@ -106,7 +106,7 @@ class ndarray: res = self._array.__and__(asarray(other)._array) return self.__class__._new(res) - def __array_namespace__(self, /, *, api_version=None): + def __array_namespace__(self: array, /, *, api_version: Optional[str] = None) -> object: if api_version is not None: raise ValueError("Unrecognized array API version") from numpy import _array_api @@ -274,7 +274,7 @@ class ndarray: # ndarray() form, like a list of booleans. raise IndexError("Only integers, slices (`:`), ellipsis (`...`), and boolean arrays are valid indices in the array API namespace") - def __getitem__(self: array, key: Union[int, slice, Tuple[Union[int, slice], ...], array], /) -> array: + def __getitem__(self: array, key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], array], /) -> array: """ Performs the operation __getitem__. """ diff --git a/numpy/_array_api/_data_type_functions.py b/numpy/_array_api/_data_type_functions.py index 0488ba915..d4816a41f 100644 --- a/numpy/_array_api/_data_type_functions.py +++ b/numpy/_array_api/_data_type_functions.py @@ -10,7 +10,7 @@ from collections.abc import Sequence import numpy as np -def finfo(type: Union[dtype, array], /) -> finfo: +def finfo(type: Union[dtype, array], /) -> finfo_object: """ Array API compatible wrapper for :py:func:`np.finfo <numpy.finfo>`. @@ -18,7 +18,7 @@ def finfo(type: Union[dtype, array], /) -> finfo: """ return np.finfo(type) -def iinfo(type: Union[dtype, array], /) -> iinfo: +def iinfo(type: Union[dtype, array], /) -> iinfo_object: """ Array API compatible wrapper for :py:func:`np.iinfo <numpy.iinfo>`. diff --git a/numpy/_array_api/_manipulation_functions.py b/numpy/_array_api/_manipulation_functions.py index 4e5ca0728..033ed23a0 100644 --- a/numpy/_array_api/_manipulation_functions.py +++ b/numpy/_array_api/_manipulation_functions.py @@ -8,7 +8,7 @@ if TYPE_CHECKING: import numpy as np -def concat(arrays: Tuple[array], /, *, axis: Optional[int] = 0) -> array: +def concat(arrays: Tuple[array, ...], /, *, axis: Optional[int] = 0) -> array: """ Array API compatible wrapper for :py:func:`np.concatenate <numpy.concatenate>`. @@ -58,7 +58,7 @@ def squeeze(x: array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None) """ return ndarray._array(np.squeeze(x._array, axis=axis)) -def stack(arrays: Tuple[array], /, *, axis: int = 0) -> array: +def stack(arrays: Tuple[array, ...], /, *, axis: int = 0) -> array: """ Array API compatible wrapper for :py:func:`np.stack <numpy.stack>`. |
