@@ -4075,21 +4075,23 @@ class integer(_IntegralMixin, _RoundMixin, number[_BitT, int]):
4075
4075
4076
4076
# keep in sync with __add__
4077
4077
@overload
4078
- def __sub__ (self , x : int , / ) -> Self : ...
4078
+ def __sub__ (self , x : _nt . CanCast0D [ Self ] | int , / ) -> Self : ...
4079
4079
@overload
4080
4080
def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
4081
4081
@overload
4082
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ... # pyright: ignore[reportIncompatibleMethodOverride]
4082
+ def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
4083
+ @overload
4084
+ def __sub__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ... # pyright: ignore[reportIncompatibleMethodOverride]
4083
4085
4084
- # keep in sync with __radd__
4086
+ #
4085
4087
@overload
4086
- def __rsub__ (self , x : int , / ) -> Self : ...
4088
+ def __rsub__ (self , x : _nt . CanCast0D [ Self ] | int , / ) -> Self : ...
4087
4089
@overload
4088
4090
def __rsub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
4089
4091
@overload
4090
4092
def __rsub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
4091
4093
@overload
4092
- def __rsub__ (self , x : _nt .Just [ integer ], / ) -> integer | float64 : ... # pyright: ignore[reportIncompatibleMethodOverride]
4094
+ def __rsub__ (self , x : _nt .PromoteWith0D [ Self , _ScalarT ], / ) -> _ScalarT : ... # pyright: ignore[reportIncompatibleMethodOverride]
4093
4095
4094
4096
# keep in sync with __add__
4095
4097
@overload
@@ -4260,29 +4262,7 @@ class signedinteger(integer[_BitT]):
4260
4262
#
4261
4263
def __init__ (self , value : _ConvertibleToInt = ..., / ) -> None : ...
4262
4264
4263
- # keep in sync with __add__
4264
- @overload
4265
- def __sub__ (self , x : _CoInt8 , / ) -> Self : ...
4266
- @overload
4267
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
4268
- @overload
4269
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
4270
- @overload
4271
- def __sub__ (self , x : _JustSignedInteger , / ) -> signedinteger : ...
4272
- @overload
4273
- def __sub__ (self , x : _nt .Just [integer ] | _JustUnsignedInteger , / ) -> signedinteger | float64 : ...
4274
-
4275
- # keep in sync with __radd__
4276
- @overload
4277
- def __rsub__ (self , x : int , / ) -> Self : ...
4278
- @overload
4279
- def __rsub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
4280
- @overload
4281
- def __rsub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
4282
- @overload
4283
- def __rsub__ (self , x : _nt .Just [integer ], / ) -> signedinteger | float64 : ...
4284
-
4285
- # keep in sync with __add__
4265
+ #
4286
4266
@overload
4287
4267
def __mul__ (self , x : _CoInt8 , / ) -> Self : ...
4288
4268
@overload
@@ -4294,7 +4274,7 @@ class signedinteger(integer[_BitT]):
4294
4274
@overload
4295
4275
def __mul__ (self , x : _nt .Just [integer ] | _JustUnsignedInteger , / ) -> signedinteger | float64 : ...
4296
4276
4297
- # keep in sync with __radd__
4277
+ #
4298
4278
@overload
4299
4279
def __rmul__ (self , x : int , / ) -> Self : ...
4300
4280
@overload
@@ -4455,32 +4435,6 @@ class unsignedinteger(integer[_BitT]):
4455
4435
#
4456
4436
def __init__ (self , value : _ConvertibleToInt = ..., / ) -> None : ...
4457
4437
4458
- # keep in sync with __add__
4459
- @overload
4460
- def __sub__ (self , x : _CoUInt8 , / ) -> Self : ...
4461
- @overload
4462
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
4463
- @overload
4464
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
4465
- @overload
4466
- def __sub__ (self , x : _JustUnsignedInteger , / ) -> unsignedinteger : ...
4467
- @overload
4468
- def __sub__ (self , x : _JustSignedInteger , / ) -> signedinteger | float64 : ...
4469
- @overload
4470
- def __sub__ (self , x : _nt .Just [integer ], / ) -> integer | float64 : ...
4471
-
4472
- # keep in sync with __radd__
4473
- @overload
4474
- def __rsub__ (self , x : int , / ) -> Self : ...
4475
- @overload
4476
- def __rsub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
4477
- @overload
4478
- def __rsub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
4479
- @overload
4480
- def __rsub__ (self , x : _nt .Just [integer ], / ) -> integer | float64 : ...
4481
- @overload
4482
- def __rsub__ (self , x : _JustSignedInteger , / ) -> signedinteger | float64 : ...
4483
-
4484
4438
# keep in sync with __add__
4485
4439
@overload
4486
4440
def __mul__ (self , x : _CoUInt8 , / ) -> Self : ...
@@ -5473,18 +5427,6 @@ bool = bool_
5473
5427
5474
5428
@type_check_only
5475
5429
class _IntROpMixin (Generic [_T_co ]):
5476
- @overload
5477
- def __rsub__ (self , x : int , / ) -> Self : ...
5478
- @overload
5479
- def __rsub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
5480
- @overload
5481
- def __rsub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
5482
- @overload
5483
- def __rsub__ (self , x : _JustSignedInteger , / ) -> _T_co : ...
5484
- @overload
5485
- def __rsub__ (self , x : _nt .Just [integer ] | _JustUnsignedInteger , / ) -> _T_co | float64 : ...
5486
-
5487
- #
5488
5430
@overload
5489
5431
def __rmul__ (self , x : int , / ) -> Self : ...
5490
5432
@overload
@@ -5589,18 +5531,6 @@ class int8(_IntROpMixin[signedinteger], signedinteger[_n._8]): # type: ignore[m
5589
5531
def __index__ (self , / ) -> int : ...
5590
5532
def bit_count (self , / ) -> int : ...
5591
5533
5592
- # keep in sync with __add__
5593
- @overload
5594
- def __sub__ (self , x : _CoInt8 , / ) -> Self : ...
5595
- @overload
5596
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
5597
- @overload
5598
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
5599
- @overload
5600
- def __sub__ (self , x : _nt .Just [integer ] | _JustUnsignedInteger , / ) -> signedinteger | float64 : ...
5601
- @overload
5602
- def __sub__ (self , x : _nt .CanArray0D [_SignedIntegerT ], / ) -> _SignedIntegerT : ...
5603
-
5604
5534
# keep in sync with __add__
5605
5535
@overload
5606
5536
def __mul__ (self , x : _CoInt8 , / ) -> Self : ...
@@ -5725,42 +5655,6 @@ class uint8(unsignedinteger[_n._8]):
5725
5655
def __index__ (self , / ) -> int : ...
5726
5656
def bit_count (self , / ) -> int : ...
5727
5657
5728
- #
5729
- @overload
5730
- def __sub__ (self , x : _CoUInt8 , / ) -> Self : ...
5731
- @overload
5732
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
5733
- @overload
5734
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
5735
- @overload
5736
- def __sub__ (self , x : _JustUnsignedInteger , / ) -> unsignedinteger : ...
5737
- @overload
5738
- def __sub__ (self , x : _JustSignedInteger , / ) -> signedinteger : ...
5739
- @overload
5740
- def __sub__ (self , x : _nt .Just [integer ], / ) -> integer : ...
5741
- @overload
5742
- def __sub__ (self , x : _nt .CanArray0D [_UnsignedIntegerT ], / ) -> _UnsignedIntegerT : ...
5743
- @overload
5744
- def __sub__ (self , x : _nt .CanArray0D [int64 ], / ) -> int64 : ...
5745
- @overload
5746
- def __sub__ (self , x : _nt .CanArray0D [int32 ], / ) -> int32 : ...
5747
- @overload
5748
- def __sub__ (self , x : _nt .CanArray0D [_Int16m ], / ) -> int16 : ...
5749
-
5750
- #
5751
- @overload
5752
- def __rsub__ (self , x : int , / ) -> Self : ...
5753
- @overload
5754
- def __rsub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
5755
- @overload
5756
- def __rsub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
5757
- @overload
5758
- def __rsub__ (self , x : _nt .Just [integer ], / ) -> integer : ...
5759
- @overload
5760
- def __rsub__ (self , x : _JustSignedInteger , / ) -> signedinteger : ...
5761
- @overload
5762
- def __rsub__ (self , x : _nt .CanArray0D [int8 ], / ) -> int16 : ...
5763
-
5764
5658
#
5765
5659
@overload
5766
5660
def __mul__ (self , x : _CoUInt8 , / ) -> Self : ...
@@ -6095,22 +5989,6 @@ class int16(_IntROpMixin[signedinteger], signedinteger[_n._16]): # type: ignore
6095
5989
def __index__ (self , / ) -> int : ...
6096
5990
def bit_count (self , / ) -> int : ...
6097
5991
6098
- #
6099
- @overload
6100
- def __sub__ (self , x : _CoInt16 , / ) -> Self : ...
6101
- @overload
6102
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
6103
- @overload
6104
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
6105
- @overload
6106
- def __sub__ (self , x : _JustSignedInteger , / ) -> signedinteger : ...
6107
- @overload
6108
- def __sub__ (self , x : _nt .Just [integer ] | _JustUnsignedInteger , / ) -> signedinteger | float64 : ...
6109
- @overload
6110
- def __sub__ (self , x : _nt .CanArray0D [int32 | uint16 ], / ) -> int32 : ...
6111
- @overload
6112
- def __sub__ (self , x : _nt .CanArray0D [int64 | uint32 ], / ) -> int64 : ...
6113
-
6114
5992
#
6115
5993
@overload
6116
5994
def __mul__ (self , x : _CoInt16 , / ) -> Self : ...
@@ -6267,40 +6145,6 @@ class uint16(unsignedinteger[_n._16]):
6267
6145
def __index__ (self , / ) -> int : ...
6268
6146
def bit_count (self , / ) -> int : ...
6269
6147
6270
- # keep in sync with __add__
6271
- @overload
6272
- def __sub__ (self , x : _CoUInt16 , / ) -> Self : ...
6273
- @overload
6274
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
6275
- @overload
6276
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
6277
- @overload
6278
- def __sub__ (self , x : _JustUnsignedInteger , / ) -> unsignedinteger : ...
6279
- @overload
6280
- def __sub__ (self , x : _JustSignedInteger , / ) -> signedinteger : ...
6281
- @overload
6282
- def __sub__ (self , x : _nt .Just [integer ], / ) -> integer : ...
6283
- @overload
6284
- def __sub__ (self , x : _nt .CanArray0D [_Int32m ], / ) -> int32 : ...
6285
- @overload
6286
- def __sub__ (self , x : _nt .CanArray0D [int64 ], / ) -> int64 : ...
6287
-
6288
- # keep in sync with __radd__
6289
- @overload
6290
- def __rsub__ (self , x : int , / ) -> Self : ...
6291
- @overload
6292
- def __rsub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
6293
- @overload
6294
- def __rsub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
6295
- @overload
6296
- def __rsub__ (self , x : _nt .Just [integer ], / ) -> integer : ...
6297
- @overload
6298
- def __rsub__ (self , x : _JustSignedInteger , / ) -> signedinteger : ...
6299
- @overload
6300
- def __rsub__ (self , x : _JustUnsignedInteger , / ) -> unsignedinteger : ...
6301
- @overload
6302
- def __rsub__ (self , x : _nt .CanArray0D [int8 ], / ) -> int32 : ...
6303
-
6304
6148
# keep in sync with __add__
6305
6149
@overload
6306
6150
def __mul__ (self , x : _CoUInt16 , / ) -> Self : ...
@@ -6616,20 +6460,6 @@ class int32(_IntROpMixin[signedinteger], signedinteger[_n._32]): # type: ignore
6616
6460
def __index__ (self , / ) -> int : ...
6617
6461
def bit_count (self , / ) -> int : ...
6618
6462
6619
- #
6620
- @overload
6621
- def __sub__ (self , x : _CoInt32 , / ) -> Self : ...
6622
- @overload
6623
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
6624
- @overload
6625
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
6626
- @overload
6627
- def __sub__ (self , x : _JustSignedInteger , / ) -> signedinteger : ...
6628
- @overload
6629
- def __sub__ (self , x : _nt .Just [integer ] | _JustUnsignedInteger , / ) -> signedinteger | float64 : ...
6630
- @overload
6631
- def __sub__ (self , x : _nt .CanArray0D [int64 | uint32 ], / ) -> int64 : ...
6632
-
6633
6463
#
6634
6464
@overload
6635
6465
def __mul__ (self , x : _CoInt32 , / ) -> Self : ...
@@ -6765,35 +6595,6 @@ class uint32(unsignedinteger[_n._32]):
6765
6595
def __hash__ (self , / ) -> int : ...
6766
6596
def __index__ (self , / ) -> int : ...
6767
6597
def bit_count (self , / ) -> int : ...
6768
-
6769
- #
6770
- @overload
6771
- def __sub__ (self , x : _CoUInt32 , / ) -> Self : ...
6772
- @overload
6773
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
6774
- @overload
6775
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
6776
- @overload
6777
- def __sub__ (self , x : _JustUnsignedInteger , / ) -> unsignedinteger : ...
6778
- @overload
6779
- def __sub__ (self , x : _nt .CanArray0D [signedinteger ] | _JustSignedInteger , / ) -> int64 : ...
6780
- @overload
6781
- def __sub__ (self , x : _nt .Just [integer ], / ) -> integer : ...
6782
-
6783
- #
6784
- @overload
6785
- def __rsub__ (self , x : _CoUInt32 , / ) -> Self : ...
6786
- @overload
6787
- def __rsub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
6788
- @overload
6789
- def __rsub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
6790
- @overload
6791
- def __rsub__ (self , x : _nt .Just [integer ], / ) -> integer : ... # type: ignore[overload-overlap]
6792
- @overload
6793
- def __rsub__ (self , x : _nt .CanArray0D [signedinteger ] | _JustSignedInteger , / ) -> int64 : ...
6794
- @overload
6795
- def __rsub__ (self , x : _JustUnsignedInteger , / ) -> unsignedinteger : ...
6796
-
6797
6598
#
6798
6599
@overload
6799
6600
def __mul__ (self , x : _CoUInt32 , / ) -> Self : ...
@@ -7055,17 +6856,7 @@ class int64(_IntROpMixin[int64], signedinteger[_n._64]): # type: ignore[misc]
7055
6856
def __index__ (self , / ) -> int : ...
7056
6857
def bit_count (self , / ) -> int : ...
7057
6858
7058
- # keep in sync with __add__
7059
- @overload
7060
- def __sub__ (self , x : _CoInt64 , / ) -> Self : ...
7061
- @overload
7062
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
7063
- @overload
7064
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
7065
- @overload
7066
- def __sub__ (self , x : _nt .Just [integer ] | _JustUnsignedInteger , / ) -> Self | float64 : ...
7067
-
7068
- # keep in sync with __add__
6859
+ #
7069
6860
@overload
7070
6861
def __mul__ (self , x : _CoInt64 , / ) -> Self : ...
7071
6862
@overload
@@ -7173,30 +6964,6 @@ class uint64(unsignedinteger[_n._64]):
7173
6964
def __index__ (self , / ) -> int : ...
7174
6965
def bit_count (self , / ) -> int : ...
7175
6966
7176
- # keep in sync with __add__
7177
- @overload
7178
- def __sub__ (self , x : _CoUInt64 , / ) -> Self : ...
7179
- @overload
7180
- def __sub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
7181
- @overload
7182
- def __sub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
7183
- @overload
7184
- def __sub__ (self , x : _nt .CanArray0D [signedinteger ] | _JustSignedInteger , / ) -> float64 : ...
7185
- @overload
7186
- def __sub__ (self , x : _nt .Just [integer ], / ) -> Self | float64 : ...
7187
-
7188
- # keep in sync with __add__
7189
- @overload
7190
- def __rsub__ (self , x : _CoUInt64 , / ) -> Self : ...
7191
- @overload
7192
- def __rsub__ (self , x : _nt .JustFloat , / ) -> float64 : ...
7193
- @overload
7194
- def __rsub__ (self , x : _nt .JustComplex , / ) -> complex128 : ...
7195
- @overload
7196
- def __rsub__ (self , x : _nt .Just [integer ], / ) -> Self | float64 : ... # type: ignore[overload-overlap]
7197
- @overload
7198
- def __rsub__ (self , x : _nt .CanArray0D [signedinteger ] | _JustSignedInteger , / ) -> float64 : ...
7199
-
7200
6967
# keep in sync with __add__
7201
6968
@overload
7202
6969
def __mul__ (self , x : _CoUInt64 , / ) -> Self : ...
0 commit comments