diff options
Diffstat (limited to 'numpy/typing/_array_like.py')
-rw-r--r-- | numpy/typing/_array_like.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/typing/_array_like.py b/numpy/typing/_array_like.py index ef6c061d1..eb8d3f4e1 100644 --- a/numpy/typing/_array_like.py +++ b/numpy/typing/_array_like.py @@ -40,11 +40,12 @@ _DType_co = TypeVar("_DType_co", covariant=True, bound="dtype[Any]") if TYPE_CHECKING or HAVE_PROTOCOL: # The `_SupportsArray` protocol only cares about the default dtype - # (i.e. `dtype=None`) of the to-be returned array. + # (i.e. `dtype=None` or no `dtype` parameter at all) of the to-be returned + # array. # Concrete implementations of the protocol are responsible for adding # any and all remaining overloads class _SupportsArray(Protocol[_DType_co]): - def __array__(self, dtype: None = ...) -> ndarray[Any, _DType_co]: ... + def __array__(self) -> ndarray[Any, _DType_co]: ... else: _SupportsArray = Any |