summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-01-15 18:21:57 +0100
committerBas van Beek <b.f.van.beek@vu.nl>2021-01-19 17:05:27 +0100
commit00067212c85e4e74a81d4bc3344b51b9364a08e0 (patch)
tree614ab2ce49c8822e713eaa7bb5f94b39bcb59b27 /numpy
parent9c63473c30b773dcab7adf699e1bd5dfcbb46e9b (diff)
downloadnumpy-00067212c85e4e74a81d4bc3344b51b9364a08e0.tar.gz
MAINT: Changed the `NBitBase` variancy in `number` from co- to invariant
Diffstat (limited to 'numpy')
-rw-r--r--numpy/__init__.pyi182
-rw-r--r--numpy/typing/_callable.py126
2 files changed, 154 insertions, 154 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index be87a166e..dbf807783 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -1527,8 +1527,8 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType, _DType]):
# See https://github.com/numpy/numpy-stubs/pull/80 for more details.
_ScalarType = TypeVar("_ScalarType", bound=generic)
-_NBit_co = TypeVar("_NBit_co", covariant=True, bound=NBitBase)
-_NBit_co2 = TypeVar("_NBit_co2", covariant=True, bound=NBitBase)
+_NBit1 = TypeVar("_NBit1", bound=NBitBase)
+_NBit2 = TypeVar("_NBit2", bound=NBitBase)
class generic(_ArrayOrScalarCommon):
@abstractmethod
@@ -1562,7 +1562,7 @@ class generic(_ArrayOrScalarCommon):
@property
def dtype(self: _ScalarType) -> dtype[_ScalarType]: ...
-class number(generic, Generic[_NBit_co]): # type: ignore
+class number(generic, Generic[_NBit1]): # type: ignore
@property
def real(self: _ArraySelf) -> _ArraySelf: ...
@property
@@ -1675,12 +1675,12 @@ else:
_FloatValue = Union[None, _CharLike_co, SupportsFloat]
_ComplexValue = Union[None, _CharLike_co, SupportsFloat, SupportsComplex]
-class integer(number[_NBit_co]): # type: ignore
+class integer(number[_NBit1]): # type: ignore
# NOTE: `__index__` is technically defined in the bottom-most
# sub-classes (`int64`, `uint32`, etc)
def __index__(self) -> int: ...
- __truediv__: _IntTrueDiv[_NBit_co]
- __rtruediv__: _IntTrueDiv[_NBit_co]
+ __truediv__: _IntTrueDiv[_NBit1]
+ __rtruediv__: _IntTrueDiv[_NBit1]
def __mod__(self, value: _IntLike_co) -> integer: ...
def __rmod__(self, value: _IntLike_co) -> integer: ...
def __invert__(self: _IntType) -> _IntType: ...
@@ -1696,32 +1696,32 @@ class integer(number[_NBit_co]): # type: ignore
def __xor__(self, other: _IntLike_co) -> integer: ...
def __rxor__(self, other: _IntLike_co) -> integer: ...
-class signedinteger(integer[_NBit_co]):
+class signedinteger(integer[_NBit1]):
def __init__(self, __value: _IntValue = ...) -> None: ...
- __add__: _SignedIntOp[_NBit_co]
- __radd__: _SignedIntOp[_NBit_co]
- __sub__: _SignedIntOp[_NBit_co]
- __rsub__: _SignedIntOp[_NBit_co]
- __mul__: _SignedIntOp[_NBit_co]
- __rmul__: _SignedIntOp[_NBit_co]
- __floordiv__: _SignedIntOp[_NBit_co]
- __rfloordiv__: _SignedIntOp[_NBit_co]
- __pow__: _SignedIntOp[_NBit_co]
- __rpow__: _SignedIntOp[_NBit_co]
- __lshift__: _SignedIntBitOp[_NBit_co]
- __rlshift__: _SignedIntBitOp[_NBit_co]
- __rshift__: _SignedIntBitOp[_NBit_co]
- __rrshift__: _SignedIntBitOp[_NBit_co]
- __and__: _SignedIntBitOp[_NBit_co]
- __rand__: _SignedIntBitOp[_NBit_co]
- __xor__: _SignedIntBitOp[_NBit_co]
- __rxor__: _SignedIntBitOp[_NBit_co]
- __or__: _SignedIntBitOp[_NBit_co]
- __ror__: _SignedIntBitOp[_NBit_co]
- __mod__: _SignedIntMod[_NBit_co]
- __rmod__: _SignedIntMod[_NBit_co]
- __divmod__: _SignedIntDivMod[_NBit_co]
- __rdivmod__: _SignedIntDivMod[_NBit_co]
+ __add__: _SignedIntOp[_NBit1]
+ __radd__: _SignedIntOp[_NBit1]
+ __sub__: _SignedIntOp[_NBit1]
+ __rsub__: _SignedIntOp[_NBit1]
+ __mul__: _SignedIntOp[_NBit1]
+ __rmul__: _SignedIntOp[_NBit1]
+ __floordiv__: _SignedIntOp[_NBit1]
+ __rfloordiv__: _SignedIntOp[_NBit1]
+ __pow__: _SignedIntOp[_NBit1]
+ __rpow__: _SignedIntOp[_NBit1]
+ __lshift__: _SignedIntBitOp[_NBit1]
+ __rlshift__: _SignedIntBitOp[_NBit1]
+ __rshift__: _SignedIntBitOp[_NBit1]
+ __rrshift__: _SignedIntBitOp[_NBit1]
+ __and__: _SignedIntBitOp[_NBit1]
+ __rand__: _SignedIntBitOp[_NBit1]
+ __xor__: _SignedIntBitOp[_NBit1]
+ __rxor__: _SignedIntBitOp[_NBit1]
+ __or__: _SignedIntBitOp[_NBit1]
+ __ror__: _SignedIntBitOp[_NBit1]
+ __mod__: _SignedIntMod[_NBit1]
+ __rmod__: _SignedIntMod[_NBit1]
+ __divmod__: _SignedIntDivMod[_NBit1]
+ __rdivmod__: _SignedIntDivMod[_NBit1]
int8 = signedinteger[_8Bit]
int16 = signedinteger[_16Bit]
@@ -1767,33 +1767,33 @@ class timedelta64(generic):
__gt__: _ComparisonOp[Union[timedelta64, _IntLike_co, _BoolLike_co]]
__ge__: _ComparisonOp[Union[timedelta64, _IntLike_co, _BoolLike_co]]
-class unsignedinteger(integer[_NBit_co]):
+class unsignedinteger(integer[_NBit1]):
# NOTE: `uint64 + signedinteger -> float64`
def __init__(self, __value: _IntValue = ...) -> None: ...
- __add__: _UnsignedIntOp[_NBit_co]
- __radd__: _UnsignedIntOp[_NBit_co]
- __sub__: _UnsignedIntOp[_NBit_co]
- __rsub__: _UnsignedIntOp[_NBit_co]
- __mul__: _UnsignedIntOp[_NBit_co]
- __rmul__: _UnsignedIntOp[_NBit_co]
- __floordiv__: _UnsignedIntOp[_NBit_co]
- __rfloordiv__: _UnsignedIntOp[_NBit_co]
- __pow__: _UnsignedIntOp[_NBit_co]
- __rpow__: _UnsignedIntOp[_NBit_co]
- __lshift__: _UnsignedIntBitOp[_NBit_co]
- __rlshift__: _UnsignedIntBitOp[_NBit_co]
- __rshift__: _UnsignedIntBitOp[_NBit_co]
- __rrshift__: _UnsignedIntBitOp[_NBit_co]
- __and__: _UnsignedIntBitOp[_NBit_co]
- __rand__: _UnsignedIntBitOp[_NBit_co]
- __xor__: _UnsignedIntBitOp[_NBit_co]
- __rxor__: _UnsignedIntBitOp[_NBit_co]
- __or__: _UnsignedIntBitOp[_NBit_co]
- __ror__: _UnsignedIntBitOp[_NBit_co]
- __mod__: _UnsignedIntMod[_NBit_co]
- __rmod__: _UnsignedIntMod[_NBit_co]
- __divmod__: _UnsignedIntDivMod[_NBit_co]
- __rdivmod__: _UnsignedIntDivMod[_NBit_co]
+ __add__: _UnsignedIntOp[_NBit1]
+ __radd__: _UnsignedIntOp[_NBit1]
+ __sub__: _UnsignedIntOp[_NBit1]
+ __rsub__: _UnsignedIntOp[_NBit1]
+ __mul__: _UnsignedIntOp[_NBit1]
+ __rmul__: _UnsignedIntOp[_NBit1]
+ __floordiv__: _UnsignedIntOp[_NBit1]
+ __rfloordiv__: _UnsignedIntOp[_NBit1]
+ __pow__: _UnsignedIntOp[_NBit1]
+ __rpow__: _UnsignedIntOp[_NBit1]
+ __lshift__: _UnsignedIntBitOp[_NBit1]
+ __rlshift__: _UnsignedIntBitOp[_NBit1]
+ __rshift__: _UnsignedIntBitOp[_NBit1]
+ __rrshift__: _UnsignedIntBitOp[_NBit1]
+ __and__: _UnsignedIntBitOp[_NBit1]
+ __rand__: _UnsignedIntBitOp[_NBit1]
+ __xor__: _UnsignedIntBitOp[_NBit1]
+ __rxor__: _UnsignedIntBitOp[_NBit1]
+ __or__: _UnsignedIntBitOp[_NBit1]
+ __ror__: _UnsignedIntBitOp[_NBit1]
+ __mod__: _UnsignedIntMod[_NBit1]
+ __rmod__: _UnsignedIntMod[_NBit1]
+ __divmod__: _UnsignedIntDivMod[_NBit1]
+ __rdivmod__: _UnsignedIntDivMod[_NBit1]
uint8 = unsignedinteger[_8Bit]
uint16 = unsignedinteger[_16Bit]
@@ -1808,29 +1808,29 @@ uint0 = unsignedinteger[_NBitIntP]
uint = unsignedinteger[_NBitInt]
ulonglong = unsignedinteger[_NBitLongLong]
-class inexact(number[_NBit_co]): ... # type: ignore
+class inexact(number[_NBit1]): ... # type: ignore
_IntType = TypeVar("_IntType", bound=integer)
_FloatType = TypeVar('_FloatType', bound=floating)
-class floating(inexact[_NBit_co]):
+class floating(inexact[_NBit1]):
def __init__(self, __value: _FloatValue = ...) -> None: ...
- __add__: _FloatOp[_NBit_co]
- __radd__: _FloatOp[_NBit_co]
- __sub__: _FloatOp[_NBit_co]
- __rsub__: _FloatOp[_NBit_co]
- __mul__: _FloatOp[_NBit_co]
- __rmul__: _FloatOp[_NBit_co]
- __truediv__: _FloatOp[_NBit_co]
- __rtruediv__: _FloatOp[_NBit_co]
- __floordiv__: _FloatOp[_NBit_co]
- __rfloordiv__: _FloatOp[_NBit_co]
- __pow__: _FloatOp[_NBit_co]
- __rpow__: _FloatOp[_NBit_co]
- __mod__: _FloatMod[_NBit_co]
- __rmod__: _FloatMod[_NBit_co]
- __divmod__: _FloatDivMod[_NBit_co]
- __rdivmod__: _FloatDivMod[_NBit_co]
+ __add__: _FloatOp[_NBit1]
+ __radd__: _FloatOp[_NBit1]
+ __sub__: _FloatOp[_NBit1]
+ __rsub__: _FloatOp[_NBit1]
+ __mul__: _FloatOp[_NBit1]
+ __rmul__: _FloatOp[_NBit1]
+ __truediv__: _FloatOp[_NBit1]
+ __rtruediv__: _FloatOp[_NBit1]
+ __floordiv__: _FloatOp[_NBit1]
+ __rfloordiv__: _FloatOp[_NBit1]
+ __pow__: _FloatOp[_NBit1]
+ __rpow__: _FloatOp[_NBit1]
+ __mod__: _FloatMod[_NBit1]
+ __rmod__: _FloatMod[_NBit1]
+ __divmod__: _FloatDivMod[_NBit1]
+ __rdivmod__: _FloatDivMod[_NBit1]
float16 = floating[_16Bit]
float32 = floating[_32Bit]
@@ -1847,25 +1847,25 @@ longfloat = floating[_NBitLongDouble]
# It is used to clarify why `complex128`s precision is `_64Bit`, the latter
# describing the two 64 bit floats representing its real and imaginary component
-class complexfloating(inexact[_NBit_co], Generic[_NBit_co, _NBit_co2]):
+class complexfloating(inexact[_NBit1], Generic[_NBit1, _NBit2]):
def __init__(self, __value: _ComplexValue = ...) -> None: ...
@property
- def real(self) -> floating[_NBit_co]: ... # type: ignore[override]
- @property
- def imag(self) -> floating[_NBit_co2]: ... # type: ignore[override]
- def __abs__(self) -> floating[_NBit_co]: ... # type: ignore[override]
- __add__: _ComplexOp[_NBit_co]
- __radd__: _ComplexOp[_NBit_co]
- __sub__: _ComplexOp[_NBit_co]
- __rsub__: _ComplexOp[_NBit_co]
- __mul__: _ComplexOp[_NBit_co]
- __rmul__: _ComplexOp[_NBit_co]
- __truediv__: _ComplexOp[_NBit_co]
- __rtruediv__: _ComplexOp[_NBit_co]
- __floordiv__: _ComplexOp[_NBit_co]
- __rfloordiv__: _ComplexOp[_NBit_co]
- __pow__: _ComplexOp[_NBit_co]
- __rpow__: _ComplexOp[_NBit_co]
+ def real(self) -> floating[_NBit1]: ... # type: ignore[override]
+ @property
+ def imag(self) -> floating[_NBit2]: ... # type: ignore[override]
+ def __abs__(self) -> floating[_NBit1]: ... # type: ignore[override]
+ __add__: _ComplexOp[_NBit1]
+ __radd__: _ComplexOp[_NBit1]
+ __sub__: _ComplexOp[_NBit1]
+ __rsub__: _ComplexOp[_NBit1]
+ __mul__: _ComplexOp[_NBit1]
+ __rmul__: _ComplexOp[_NBit1]
+ __truediv__: _ComplexOp[_NBit1]
+ __rtruediv__: _ComplexOp[_NBit1]
+ __floordiv__: _ComplexOp[_NBit1]
+ __rfloordiv__: _ComplexOp[_NBit1]
+ __pow__: _ComplexOp[_NBit1]
+ __rpow__: _ComplexOp[_NBit1]
complex64 = complexfloating[_32Bit, _32Bit]
complex128 = complexfloating[_64Bit, _64Bit]
diff --git a/numpy/typing/_callable.py b/numpy/typing/_callable.py
index 693b6dfed..77e3ee0c4 100644
--- a/numpy/typing/_callable.py
+++ b/numpy/typing/_callable.py
@@ -61,8 +61,8 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
_T = TypeVar("_T")
_2Tuple = Tuple[_T, _T]
- _NBit_co = TypeVar("_NBit_co", covariant=True, bound=NBitBase)
- _NBit = TypeVar("_NBit", bound=NBitBase)
+ _NBit1 = TypeVar("_NBit1", bound=NBitBase)
+ _NBit2 = TypeVar("_NBit2", bound=NBitBase)
_IntType = TypeVar("_IntType", bound=integer)
_FloatType = TypeVar("_FloatType", bound=floating)
@@ -141,9 +141,9 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: _FloatLike_co) -> timedelta64: ...
- class _IntTrueDiv(Protocol[_NBit_co]):
+ class _IntTrueDiv(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> floating[_NBit_co]: ...
+ def __call__(self, __other: bool) -> floating[_NBit1]: ...
@overload
def __call__(self, __other: int) -> floating[_NBitInt]: ...
@overload
@@ -151,12 +151,12 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
@overload
def __call__(self, __other: complex) -> complex128: ...
@overload
- def __call__(self, __other: integer[_NBit]) -> floating[Union[_NBit_co, _NBit]]: ...
+ def __call__(self, __other: integer[_NBit2]) -> floating[Union[_NBit1, _NBit2]]: ...
- class _UnsignedIntOp(Protocol[_NBit_co]):
+ class _UnsignedIntOp(Protocol[_NBit1]):
# NOTE: `uint64 + signedinteger -> float64`
@overload
- def __call__(self, __other: bool) -> unsignedinteger[_NBit_co]: ...
+ def __call__(self, __other: bool) -> unsignedinteger[_NBit1]: ...
@overload
def __call__(
self, __other: Union[int, signedinteger[Any]]
@@ -167,24 +167,24 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
def __call__(self, __other: complex) -> complex128: ...
@overload
def __call__(
- self, __other: unsignedinteger[_NBit]
- ) -> unsignedinteger[Union[_NBit_co, _NBit]]: ...
+ self, __other: unsignedinteger[_NBit2]
+ ) -> unsignedinteger[Union[_NBit1, _NBit2]]: ...
- class _UnsignedIntBitOp(Protocol[_NBit_co]):
+ class _UnsignedIntBitOp(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> unsignedinteger[_NBit_co]: ...
+ def __call__(self, __other: bool) -> unsignedinteger[_NBit1]: ...
@overload
def __call__(self, __other: int) -> signedinteger[Any]: ...
@overload
def __call__(self, __other: signedinteger[Any]) -> signedinteger[Any]: ...
@overload
def __call__(
- self, __other: unsignedinteger[_NBit]
- ) -> unsignedinteger[Union[_NBit_co, _NBit]]: ...
+ self, __other: unsignedinteger[_NBit2]
+ ) -> unsignedinteger[Union[_NBit1, _NBit2]]: ...
- class _UnsignedIntMod(Protocol[_NBit_co]):
+ class _UnsignedIntMod(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> unsignedinteger[_NBit_co]: ...
+ def __call__(self, __other: bool) -> unsignedinteger[_NBit1]: ...
@overload
def __call__(
self, __other: Union[int, signedinteger[Any]]
@@ -193,12 +193,12 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
def __call__(self, __other: float) -> float64: ...
@overload
def __call__(
- self, __other: unsignedinteger[_NBit]
- ) -> unsignedinteger[Union[_NBit_co, _NBit]]: ...
+ self, __other: unsignedinteger[_NBit2]
+ ) -> unsignedinteger[Union[_NBit1, _NBit2]]: ...
- class _UnsignedIntDivMod(Protocol[_NBit_co]):
+ class _UnsignedIntDivMod(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> _2Tuple[signedinteger[_NBit_co]]: ...
+ def __call__(self, __other: bool) -> _2Tuple[signedinteger[_NBit1]]: ...
@overload
def __call__(
self, __other: Union[int, signedinteger[Any]]
@@ -207,111 +207,111 @@ if TYPE_CHECKING or HAVE_PROTOCOL:
def __call__(self, __other: float) -> _2Tuple[float64]: ...
@overload
def __call__(
- self, __other: unsignedinteger[_NBit]
- ) -> _2Tuple[unsignedinteger[Union[_NBit_co, _NBit]]]: ...
+ self, __other: unsignedinteger[_NBit2]
+ ) -> _2Tuple[unsignedinteger[Union[_NBit1, _NBit2]]]: ...
- class _SignedIntOp(Protocol[_NBit_co]):
+ class _SignedIntOp(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> signedinteger[_NBit_co]: ...
+ def __call__(self, __other: bool) -> signedinteger[_NBit1]: ...
@overload
- def __call__(self, __other: int) -> signedinteger[Union[_NBit_co, _NBitInt]]: ...
+ def __call__(self, __other: int) -> signedinteger[Union[_NBit1, _NBitInt]]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
def __call__(self, __other: complex) -> complex128: ...
@overload
def __call__(
- self, __other: signedinteger[_NBit]
- ) -> signedinteger[Union[_NBit_co, _NBit]]: ...
+ self, __other: signedinteger[_NBit2]
+ ) -> signedinteger[Union[_NBit1, _NBit2]]: ...
- class _SignedIntBitOp(Protocol[_NBit_co]):
+ class _SignedIntBitOp(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> signedinteger[_NBit_co]: ...
+ def __call__(self, __other: bool) -> signedinteger[_NBit1]: ...
@overload
- def __call__(self, __other: int) -> signedinteger[Union[_NBit_co, _NBitInt]]: ...
+ def __call__(self, __other: int) -> signedinteger[Union[_NBit1, _NBitInt]]: ...
@overload
def __call__(
- self, __other: signedinteger[_NBit]
- ) -> signedinteger[Union[_NBit_co, _NBit]]: ...
+ self, __other: signedinteger[_NBit2]
+ ) -> signedinteger[Union[_NBit1, _NBit2]]: ...
- class _SignedIntMod(Protocol[_NBit_co]):
+ class _SignedIntMod(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> signedinteger[_NBit_co]: ...
+ def __call__(self, __other: bool) -> signedinteger[_NBit1]: ...
@overload
- def __call__(self, __other: int) -> signedinteger[Union[_NBit_co, _NBitInt]]: ...
+ def __call__(self, __other: int) -> signedinteger[Union[_NBit1, _NBitInt]]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
def __call__(
- self, __other: signedinteger[_NBit]
- ) -> signedinteger[Union[_NBit_co, _NBit]]: ...
+ self, __other: signedinteger[_NBit2]
+ ) -> signedinteger[Union[_NBit1, _NBit2]]: ...
- class _SignedIntDivMod(Protocol[_NBit_co]):
+ class _SignedIntDivMod(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> _2Tuple[signedinteger[_NBit_co]]: ...
+ def __call__(self, __other: bool) -> _2Tuple[signedinteger[_NBit1]]: ...
@overload
- def __call__(self, __other: int) -> _2Tuple[signedinteger[Union[_NBit_co, _NBitInt]]]: ...
+ def __call__(self, __other: int) -> _2Tuple[signedinteger[Union[_NBit1, _NBitInt]]]: ...
@overload
def __call__(self, __other: float) -> _2Tuple[float64]: ...
@overload
def __call__(
- self, __other: signedinteger[_NBit]
- ) -> _2Tuple[signedinteger[Union[_NBit_co, _NBit]]]: ...
+ self, __other: signedinteger[_NBit2]
+ ) -> _2Tuple[signedinteger[Union[_NBit1, _NBit2]]]: ...
- class _FloatOp(Protocol[_NBit_co]):
+ class _FloatOp(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> floating[_NBit_co]: ...
+ def __call__(self, __other: bool) -> floating[_NBit1]: ...
@overload
- def __call__(self, __other: int) -> floating[Union[_NBit_co, _NBitInt]]: ...
+ def __call__(self, __other: int) -> floating[Union[_NBit1, _NBitInt]]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
def __call__(self, __other: complex) -> complex128: ...
@overload
def __call__(
- self, __other: Union[integer[_NBit], floating[_NBit]]
- ) -> floating[Union[_NBit_co, _NBit]]: ...
+ self, __other: Union[integer[_NBit2], floating[_NBit2]]
+ ) -> floating[Union[_NBit1, _NBit2]]: ...
- class _FloatMod(Protocol[_NBit_co]):
+ class _FloatMod(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> floating[_NBit_co]: ...
+ def __call__(self, __other: bool) -> floating[_NBit1]: ...
@overload
- def __call__(self, __other: int) -> floating[Union[_NBit_co, _NBitInt]]: ...
+ def __call__(self, __other: int) -> floating[Union[_NBit1, _NBitInt]]: ...
@overload
def __call__(self, __other: float) -> float64: ...
@overload
def __call__(
- self, __other: Union[integer[_NBit], floating[_NBit]]
- ) -> floating[Union[_NBit_co, _NBit]]: ...
+ self, __other: Union[integer[_NBit2], floating[_NBit2]]
+ ) -> floating[Union[_NBit1, _NBit2]]: ...
- class _FloatDivMod(Protocol[_NBit_co]):
+ class _FloatDivMod(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> _2Tuple[floating[_NBit_co]]: ...
+ def __call__(self, __other: bool) -> _2Tuple[floating[_NBit1]]: ...
@overload
- def __call__(self, __other: int) -> _2Tuple[floating[Union[_NBit_co, _NBitInt]]]: ...
+ def __call__(self, __other: int) -> _2Tuple[floating[Union[_NBit1, _NBitInt]]]: ...
@overload
def __call__(self, __other: float) -> _2Tuple[float64]: ...
@overload
def __call__(
- self, __other: Union[integer[_NBit], floating[_NBit]]
- ) -> _2Tuple[floating[Union[_NBit_co, _NBit]]]: ...
+ self, __other: Union[integer[_NBit2], floating[_NBit2]]
+ ) -> _2Tuple[floating[Union[_NBit1, _NBit2]]]: ...
- class _ComplexOp(Protocol[_NBit_co]):
+ class _ComplexOp(Protocol[_NBit1]):
@overload
- def __call__(self, __other: bool) -> complexfloating[_NBit_co, _NBit_co]: ...
+ def __call__(self, __other: bool) -> complexfloating[_NBit1, _NBit1]: ...
@overload
- def __call__(self, __other: int) -> complexfloating[Union[_NBit_co, _NBitInt], Union[_NBit_co, _NBitInt]]: ...
+ def __call__(self, __other: int) -> complexfloating[Union[_NBit1, _NBitInt], Union[_NBit1, _NBitInt]]: ...
@overload
def __call__(self, __other: Union[float, complex]) -> complex128: ...
@overload
def __call__(
self,
__other: Union[
- integer[_NBit],
- floating[_NBit],
- complexfloating[_NBit, _NBit],
+ integer[_NBit2],
+ floating[_NBit2],
+ complexfloating[_NBit2, _NBit2],
]
- ) -> complexfloating[Union[_NBit_co, _NBit], Union[_NBit_co, _NBit]]: ...
+ ) -> complexfloating[Union[_NBit1, _NBit2], Union[_NBit1, _NBit2]]: ...
class _NumberOp(Protocol):
def __call__(self, __other: _NumberLike_co) -> number: ...