@@ -134,12 +134,6 @@ from numpy._typing import (
134134)
135135
136136from numpy ._typing ._callable import (
137- _BoolOp ,
138- _BoolBitOp ,
139- _BoolSub ,
140- _BoolTrueDiv ,
141- _BoolMod ,
142- _BoolDivMod ,
143137 _IntTrueDiv ,
144138 _UnsignedIntOp ,
145139 _UnsignedIntBitOp ,
@@ -803,6 +797,7 @@ _1NShapeT = TypeVar("_1NShapeT", bound=tuple[L[1], *tuple[L[1], ...]]) # (1,) |
803797_ScalarT = TypeVar ("_ScalarT" , bound = generic )
804798_ScalarT_co = TypeVar ("_ScalarT_co" , bound = generic , default = Any , covariant = True )
805799_NumberT = TypeVar ("_NumberT" , bound = number )
800+ _InexactT = TypeVar ("_InexactT" , bound = inexact )
806801_RealNumberT = TypeVar ("_RealNumberT" , bound = floating | integer )
807802_FloatingT_co = TypeVar ("_FloatingT_co" , bound = floating , default = floating , covariant = True )
808803_IntegerT = TypeVar ("_IntegerT" , bound = integer )
@@ -3824,12 +3819,14 @@ class bool(generic[_BoolItemT_co], Generic[_BoolItemT_co]):
38243819 def __init__ (self : np .bool [builtins .bool ], value : object , / ) -> None : ...
38253820
38263821 def __bool__ (self , / ) -> _BoolItemT_co : ...
3822+
38273823 @overload
38283824 def __int__ (self : np .bool [L [False ]], / ) -> L [0 ]: ...
38293825 @overload
38303826 def __int__ (self : np .bool [L [True ]], / ) -> L [1 ]: ...
38313827 @overload
38323828 def __int__ (self , / ) -> L [0 , 1 ]: ...
3829+
38333830 def __abs__ (self ) -> Self : ...
38343831
38353832 @overload
@@ -3839,23 +3836,191 @@ class bool(generic[_BoolItemT_co], Generic[_BoolItemT_co]):
38393836 @overload
38403837 def __invert__ (self , / ) -> np .bool : ...
38413838
3842- __add__ : _BoolOp [np .bool ]
3843- __radd__ : _BoolOp [np .bool ]
3844- __sub__ : _BoolSub
3845- __rsub__ : _BoolSub
3846- __mul__ : _BoolOp [np .bool ]
3847- __rmul__ : _BoolOp [np .bool ]
3848- __truediv__ : _BoolTrueDiv
3849- __rtruediv__ : _BoolTrueDiv
3850- __floordiv__ : _BoolOp [int8 ]
3851- __rfloordiv__ : _BoolOp [int8 ]
3852- __pow__ : _BoolOp [int8 ]
3853- __rpow__ : _BoolOp [int8 ]
3854-
3855- __lshift__ : _BoolBitOp [int8 ]
3856- __rlshift__ : _BoolBitOp [int8 ]
3857- __rshift__ : _BoolBitOp [int8 ]
3858- __rrshift__ : _BoolBitOp [int8 ]
3839+ @overload
3840+ def __add__ (self , other : _NumberT , / ) -> _NumberT : ...
3841+ @overload
3842+ def __add__ (self , other : builtins .bool | bool_ , / ) -> bool_ : ...
3843+ @overload
3844+ def __add__ (self , other : int , / ) -> int_ : ...
3845+ @overload
3846+ def __add__ (self , other : float , / ) -> float64 : ...
3847+ @overload
3848+ def __add__ (self , other : complex , / ) -> complex128 : ...
3849+
3850+ @overload
3851+ def __radd__ (self , other : _NumberT , / ) -> _NumberT : ...
3852+ @overload
3853+ def __radd__ (self , other : builtins .bool , / ) -> bool_ : ...
3854+ @overload
3855+ def __radd__ (self , other : int , / ) -> int_ : ...
3856+ @overload
3857+ def __radd__ (self , other : float , / ) -> float64 : ...
3858+ @overload
3859+ def __radd__ (self , other : complex , / ) -> complex128 : ...
3860+
3861+ @overload
3862+ def __sub__ (self , other : _NumberT , / ) -> _NumberT : ...
3863+ @overload
3864+ def __sub__ (self , other : int , / ) -> int_ : ...
3865+ @overload
3866+ def __sub__ (self , other : float , / ) -> float64 : ...
3867+ @overload
3868+ def __sub__ (self , other : complex , / ) -> complex128 : ...
3869+
3870+ @overload
3871+ def __rsub__ (self , other : _NumberT , / ) -> _NumberT : ...
3872+ @overload
3873+ def __rsub__ (self , other : int , / ) -> int_ : ...
3874+ @overload
3875+ def __rsub__ (self , other : float , / ) -> float64 : ...
3876+ @overload
3877+ def __rsub__ (self , other : complex , / ) -> complex128 : ...
3878+
3879+ @overload
3880+ def __mul__ (self , other : _NumberT , / ) -> _NumberT : ...
3881+ @overload
3882+ def __mul__ (self , other : builtins .bool | bool_ , / ) -> bool_ : ...
3883+ @overload
3884+ def __mul__ (self , other : int , / ) -> int_ : ...
3885+ @overload
3886+ def __mul__ (self , other : float , / ) -> float64 : ...
3887+ @overload
3888+ def __mul__ (self , other : complex , / ) -> complex128 : ...
3889+
3890+ @overload
3891+ def __rmul__ (self , other : _NumberT , / ) -> _NumberT : ...
3892+ @overload
3893+ def __rmul__ (self , other : builtins .bool , / ) -> bool_ : ...
3894+ @overload
3895+ def __rmul__ (self , other : int , / ) -> int_ : ...
3896+ @overload
3897+ def __rmul__ (self , other : float , / ) -> float64 : ...
3898+ @overload
3899+ def __rmul__ (self , other : complex , / ) -> complex128 : ...
3900+
3901+ @overload
3902+ def __pow__ (self , other : _NumberT , mod : None = None , / ) -> _NumberT : ...
3903+ @overload
3904+ def __pow__ (self , other : builtins .bool | bool_ , mod : None = None , / ) -> int8 : ...
3905+ @overload
3906+ def __pow__ (self , other : int , mod : None = None , / ) -> int_ : ...
3907+ @overload
3908+ def __pow__ (self , other : float , mod : None = None , / ) -> float64 : ...
3909+ @overload
3910+ def __pow__ (self , other : complex , mod : None = None , / ) -> complex128 : ...
3911+
3912+ @overload
3913+ def __rpow__ (self , other : _NumberT , mod : None = None , / ) -> _NumberT : ...
3914+ @overload
3915+ def __rpow__ (self , other : builtins .bool , mod : None = None , / ) -> int8 : ...
3916+ @overload
3917+ def __rpow__ (self , other : int , mod : None = None , / ) -> int_ : ...
3918+ @overload
3919+ def __rpow__ (self , other : float , mod : None = None , / ) -> float64 : ...
3920+ @overload
3921+ def __rpow__ (self , other : complex , mod : None = None , / ) -> complex128 : ...
3922+
3923+ @overload
3924+ def __truediv__ (self , other : _InexactT , / ) -> _InexactT : ...
3925+ @overload
3926+ def __truediv__ (self , other : float | integer | bool_ , / ) -> float64 : ...
3927+ @overload
3928+ def __truediv__ (self , other : complex , / ) -> complex128 : ...
3929+
3930+ @overload
3931+ def __rtruediv__ (self , other : _InexactT , / ) -> _InexactT : ...
3932+ @overload
3933+ def __rtruediv__ (self , other : float | integer , / ) -> float64 : ...
3934+ @overload
3935+ def __rtruediv__ (self , other : complex , / ) -> complex128 : ...
3936+
3937+ @overload
3938+ def __floordiv__ (self , other : _RealNumberT , / ) -> _RealNumberT : ...
3939+ @overload
3940+ def __floordiv__ (self , other : builtins .bool | bool_ , / ) -> int8 : ...
3941+ @overload
3942+ def __floordiv__ (self , other : int , / ) -> int_ : ...
3943+ @overload
3944+ def __floordiv__ (self , other : float , / ) -> float64 : ...
3945+
3946+ @overload
3947+ def __rfloordiv__ (self , other : _RealNumberT , / ) -> _RealNumberT : ...
3948+ @overload
3949+ def __rfloordiv__ (self , other : builtins .bool , / ) -> int8 : ...
3950+ @overload
3951+ def __rfloordiv__ (self , other : int , / ) -> int_ : ...
3952+ @overload
3953+ def __rfloordiv__ (self , other : float , / ) -> float64 : ...
3954+
3955+ # keep in sync with __floordiv__
3956+ @overload
3957+ def __mod__ (self , other : _RealNumberT , / ) -> _RealNumberT : ...
3958+ @overload
3959+ def __mod__ (self , other : builtins .bool | bool_ , / ) -> int8 : ...
3960+ @overload
3961+ def __mod__ (self , other : int , / ) -> int_ : ...
3962+ @overload
3963+ def __mod__ (self , other : float , / ) -> float64 : ...
3964+
3965+ # keep in sync with __rfloordiv__
3966+ @overload
3967+ def __rmod__ (self , other : _RealNumberT , / ) -> _RealNumberT : ...
3968+ @overload
3969+ def __rmod__ (self , other : builtins .bool , / ) -> int8 : ...
3970+ @overload
3971+ def __rmod__ (self , other : int , / ) -> int_ : ...
3972+ @overload
3973+ def __rmod__ (self , other : float , / ) -> float64 : ...
3974+
3975+ # keep in sync with __mod__
3976+ @overload
3977+ def __divmod__ (self , other : _RealNumberT , / ) -> _2Tuple [_RealNumberT ]: ...
3978+ @overload
3979+ def __divmod__ (self , other : builtins .bool | bool_ , / ) -> _2Tuple [int8 ]: ...
3980+ @overload
3981+ def __divmod__ (self , other : int , / ) -> _2Tuple [int_ ]: ...
3982+ @overload
3983+ def __divmod__ (self , other : float , / ) -> _2Tuple [float64 ]: ...
3984+
3985+ # keep in sync with __rmod__
3986+ @overload
3987+ def __rdivmod__ (self , other : _RealNumberT , / ) -> _2Tuple [_RealNumberT ]: ...
3988+ @overload
3989+ def __rdivmod__ (self , other : builtins .bool , / ) -> _2Tuple [int8 ]: ...
3990+ @overload
3991+ def __rdivmod__ (self , other : int , / ) -> _2Tuple [int_ ]: ...
3992+ @overload
3993+ def __rdivmod__ (self , other : float , / ) -> _2Tuple [float64 ]: ...
3994+
3995+ @overload
3996+ def __lshift__ (self , other : _IntegerT , / ) -> _IntegerT : ...
3997+ @overload
3998+ def __lshift__ (self , other : builtins .bool | bool_ , / ) -> int8 : ...
3999+ @overload
4000+ def __lshift__ (self , other : int , / ) -> int_ : ...
4001+
4002+ @overload
4003+ def __rlshift__ (self , other : _IntegerT , / ) -> _IntegerT : ...
4004+ @overload
4005+ def __rlshift__ (self , other : builtins .bool , / ) -> int8 : ...
4006+ @overload
4007+ def __rlshift__ (self , other : int , / ) -> int_ : ...
4008+
4009+ # keep in sync with __lshift__
4010+ @overload
4011+ def __rshift__ (self , other : _IntegerT , / ) -> _IntegerT : ...
4012+ @overload
4013+ def __rshift__ (self , other : builtins .bool | bool_ , / ) -> int8 : ...
4014+ @overload
4015+ def __rshift__ (self , other : int , / ) -> int_ : ...
4016+
4017+ # keep in sync with __rlshift__
4018+ @overload
4019+ def __rrshift__ (self , other : _IntegerT , / ) -> _IntegerT : ...
4020+ @overload
4021+ def __rrshift__ (self , other : builtins .bool , / ) -> int8 : ...
4022+ @overload
4023+ def __rrshift__ (self , other : int , / ) -> int_ : ...
38594024
38604025 @overload
38614026 def __and__ (self : np .bool [L [False ]], other : builtins .bool | np .bool , / ) -> np .bool [L [False ]]: ...
@@ -3899,11 +4064,6 @@ class bool(generic[_BoolItemT_co], Generic[_BoolItemT_co]):
38994064 def __or__ (self , other : int , / ) -> np .bool | intp : ...
39004065 __ror__ = __or__
39014066
3902- __mod__ : _BoolMod
3903- __rmod__ : _BoolMod
3904- __divmod__ : _BoolDivMod
3905- __rdivmod__ : _BoolDivMod
3906-
39074067 __lt__ : _ComparisonOpLT [_NumberLike_co , _ArrayLikeNumber_co ]
39084068 __le__ : _ComparisonOpLE [_NumberLike_co , _ArrayLikeNumber_co ]
39094069 __gt__ : _ComparisonOpGT [_NumberLike_co , _ArrayLikeNumber_co ]
0 commit comments