summaryrefslogtreecommitdiff
path: root/numpy/array_api/_array_object.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/array_api/_array_object.py')
-rw-r--r--numpy/array_api/_array_object.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/array_api/_array_object.py b/numpy/array_api/_array_object.py
index 900a0ae1e..93ae10603 100644
--- a/numpy/array_api/_array_object.py
+++ b/numpy/array_api/_array_object.py
@@ -125,10 +125,7 @@ class Array:
# spec in places where it either deviates from or is more strict than
# NumPy behavior
- # NOTE: no valid type annotation possible. E.g `Union[Array,
- # NotImplemented]` is forbidden, see https://github.com/python/mypy/issues/363
- # Maybe change returned object to `Literal['NotImplemented']`?
- def _check_allowed_dtypes(self, other, dtype_category, op):
+ def _check_allowed_dtypes(self, other: bool | int | float | Array, dtype_category: str, op: str) -> Array:
"""
Helper function for operators to only allow specific input dtypes