diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-04-21 19:00:56 +0200 |
---|---|---|
committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-04-30 22:09:51 +0200 |
commit | a63315aec7c51cc5e3bb0bc0ccfe8fad7d508659 (patch) | |
tree | 8cc4a6ffc63a1c042da19815ba4232b4699dc544 /numpy | |
parent | 5fad83954e41d33e2a6e27fd77f98975cc81caef (diff) | |
download | numpy-a63315aec7c51cc5e3bb0bc0ccfe8fad7d508659.tar.gz |
MAINT: Remove unsafe unions from `np.typing._callable`
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/typing/_callable.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/typing/_callable.py b/numpy/typing/_callable.py index 23cabd47a..30c210b62 100644 --- a/numpy/typing/_callable.py +++ b/numpy/typing/_callable.py @@ -47,7 +47,7 @@ from ._scalars import ( _NumberLike_co, ) from . import NBitBase -from ._array_like import ArrayLike, _ArrayOrScalar +from ._array_like import ArrayLike, _ArrayND if sys.version_info >= (3, 8): from typing import Protocol @@ -168,7 +168,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL: @overload def __call__( self, __other: Union[int, signedinteger[Any]] - ) -> Union[signedinteger[Any], float64]: ... + ) -> Any: ... @overload def __call__(self, __other: float) -> floating[Union[_NBit1, _NBitDouble]]: ... @overload @@ -198,7 +198,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL: @overload def __call__( self, __other: Union[int, signedinteger[Any]] - ) -> Union[signedinteger[Any], float64]: ... + ) -> Any: ... @overload def __call__(self, __other: float) -> floating[Union[_NBit1, _NBitDouble]]: ... @overload @@ -212,7 +212,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL: @overload def __call__( self, __other: Union[int, signedinteger[Any]] - ) -> Union[_2Tuple[signedinteger[Any]], _2Tuple[float64]]: ... + ) -> _2Tuple[Any]: ... @overload def __call__(self, __other: float) -> _2Tuple[floating[Union[_NBit1, _NBitDouble]]]: ... @overload @@ -336,7 +336,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL: @overload def __call__(self, __other: _T1) -> bool_: ... @overload - def __call__(self, __other: _T2) -> _ArrayOrScalar[bool_]: ... + def __call__(self, __other: _T2) -> _ArrayND[bool_]: ... else: _BoolOp = Any |