Skip to content

Commit 26428e4

Browse files
authored
TYP: accept review comment on ignoring NotImplemented in type checking
Co-authored-by: Bas van Beek <[email protected]> Original NumPy Commit: 890c0cfe15f0e3325b57e44f9b9a9f78f9797f25
1 parent d14b8f6 commit 26428e4

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

array_api_strict/_array_object.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,7 @@ def __array__(self, dtype: None | np.dtype[Any] = None) -> npt.NDArray[Any]:
125125
# spec in places where it either deviates from or is more strict than
126126
# NumPy behavior
127127

128-
# NOTE: no valid type annotation possible. E.g `Union[Array,
129-
# NotImplemented]` is forbidden, see https://github.com/python/mypy/issues/363
130-
# Maybe change returned object to `Literal['NotImplemented']`?
131-
def _check_allowed_dtypes(self, other, dtype_category, op):
128+
def _check_allowed_dtypes(self, other: bool | int | float | Array, dtype_category: str, op: str) -> Array:
132129
"""
133130
Helper function for operators to only allow specific input dtypes
134131

0 commit comments

Comments
 (0)