diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2022-01-04 08:17:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 08:17:10 +0100 |
commit | 890c0cfe15f0e3325b57e44f9b9a9f78f9797f25 (patch) | |
tree | 40f7591b320920c1d4d9d92442b4a405bc06a76d /numpy/array_api/_array_object.py | |
parent | 5c04e06dacb714fb8381db003eb0f22c08c91417 (diff) | |
download | numpy-890c0cfe15f0e3325b57e44f9b9a9f78f9797f25.tar.gz |
TYP: accept review comment on ignoring NotImplemented in type checking
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
Diffstat (limited to 'numpy/array_api/_array_object.py')
-rw-r--r-- | numpy/array_api/_array_object.py | 5 |
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 |