summaryrefslogtreecommitdiff
path: root/numpy/typing/_callable.py
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2020-11-24 22:55:33 +0100
committerBas van Beek <b.f.van.beek@vu.nl>2020-12-22 17:24:04 +0100
commit133cf30ad1f34d1d6990133502c5a30209b51e6f (patch)
treea7b8228c42adbcc8f7de434f7451676eb3b3d5a8 /numpy/typing/_callable.py
parent0daed8701f941945a10daf4969843a346c933baf (diff)
downloadnumpy-133cf30ad1f34d1d6990133502c5a30209b51e6f.tar.gz
ENH: Take the precision of `np.int_` into account arithmetic operations
Diffstat (limited to 'numpy/typing/_callable.py')
-rw-r--r--numpy/typing/_callable.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/numpy/typing/_callable.py b/numpy/typing/_callable.py
index 831921fd7..8f464cc75 100644
--- a/numpy/typing/_callable.py
+++ b/numpy/typing/_callable.py
@@ -29,11 +29,13 @@ from numpy import (
unsignedinteger,
signedinteger,
int8,
+ int_,
floating,
float64,
complexfloating,
complex128,
)
+from ._nbit import _NBitInt
from ._scalars import (
_BoolLike,
_IntLike,
@@ -72,7 +74,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: _BoolLike) -> _GenericType_co: ...
@overload # platform dependent
- def __call__(self, __other: int) -> signedinteger[Any]: ...
+ def __call__(self, __other: int) -> int_: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
@@ -84,7 +86,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: _BoolLike) -> _GenericType_co: ...
@overload # platform dependent
- def __call__(self, __other: int) -> signedinteger[Any]: ...
+ def __call__(self, __other: int) -> int_: ...
@overload
def __call__(self, __other: _IntType) -> _IntType: ...
@@ -93,7 +95,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> NoReturn: ...
@overload # platform dependent
- def __call__(self, __other: int) -> signedinteger[Any]: ...
+ def __call__(self, __other: int) -> int_: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
@@ -113,7 +115,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: _BoolLike) -> int8: ...
@overload # platform dependent
- def __call__(self, __other: int) -> signedinteger[Any]: ...
+ def __call__(self, __other: int) -> int_: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
@@ -125,7 +127,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: _BoolLike) -> _2Tuple[int8]: ...
@overload # platform dependent
- def __call__(self, __other: int) -> _2Tuple[signedinteger[Any]]: ...
+ def __call__(self, __other: int) -> _2Tuple[int_]: ...
@overload
def __call__(self, __other: float) -> _2Tuple[float64]: ...
@overload
@@ -143,7 +145,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> floating[_NBit_co]: ...
@overload
- def __call__(self, __other: int) -> floating[Any]: ...
+ def __call__(self, __other: int) -> floating[_NBitInt]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
@@ -212,7 +214,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> signedinteger[_NBit_co]: ...
@overload
- def __call__(self, __other: int) -> signedinteger[Any]: ...
+ def __call__(self, __other: int) -> signedinteger[Union[_NBit_co, _NBitInt]]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
@@ -226,7 +228,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> signedinteger[_NBit_co]: ...
@overload
- def __call__(self, __other: int) -> signedinteger[Any]: ...
+ def __call__(self, __other: int) -> signedinteger[Union[_NBit_co, _NBitInt]]: ...
@overload
def __call__(
self, __other: signedinteger[_NBit]
@@ -236,7 +238,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> signedinteger[_NBit_co]: ...
@overload
- def __call__(self, __other: int) -> signedinteger[Any]: ...
+ def __call__(self, __other: int) -> signedinteger[Union[_NBit_co, _NBitInt]]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
@@ -248,7 +250,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> _2Tuple[signedinteger[_NBit_co]]: ...
@overload
- def __call__(self, __other: int) -> _2Tuple[signedinteger[Any]]: ...
+ def __call__(self, __other: int) -> _2Tuple[signedinteger[Union[_NBit_co, _NBitInt]]]: ...
@overload
def __call__(self, __other: float) -> _2Tuple[float64]: ...
@overload
@@ -260,7 +262,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> floating[_NBit_co]: ...
@overload
- def __call__(self, __other: int) -> floating[Any]: ...
+ def __call__(self, __other: int) -> floating[Union[_NBit_co, _NBitInt]]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
@@ -274,7 +276,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> floating[_NBit_co]: ...
@overload
- def __call__(self, __other: int) -> floating[Any]: ...
+ def __call__(self, __other: int) -> floating[Union[_NBit_co, _NBitInt]]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
@@ -286,7 +288,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> _2Tuple[floating[_NBit_co]]: ...
@overload
- def __call__(self, __other: int) -> _2Tuple[floating[Any]]: ...
+ def __call__(self, __other: int) -> _2Tuple[floating[Union[_NBit_co, _NBitInt]]]: ...
@overload
def __call__(self, __other: float) -> _2Tuple[float64]: ...
@overload
@@ -298,7 +300,7 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: bool) -> complexfloating[_NBit_co, _NBit_co]: ...
@overload
- def __call__(self, __other: int) -> complexfloating[Any, Any]: ...
+ def __call__(self, __other: int) -> complexfloating[Union[_NBit_co, _NBitInt], Union[_NBit_co, _NBitInt]]: ...
@overload
def __call__(self, __other: Union[float, complex]) -> complex128: ...
@overload