@@ -628,9 +628,7 @@ _RealScalarT = TypeVar("_RealScalarT", bound=bool_ | integer | floating | object
628
628
_IntegerT = TypeVar ("_IntegerT" , bound = integer )
629
629
_FloatingT = TypeVar ("_FloatingT" , bound = floating )
630
630
_ComplexFloatingT = TypeVar ("_ComplexFloatingT" , bound = complexfloating )
631
- _ComplexFloatingT_co = TypeVar ("_ComplexFloatingT_co" , bound = complexfloating , covariant = True )
632
631
_InexactT = TypeVar ("_InexactT" , bound = inexact )
633
- _InexactT_co = TypeVar ("_InexactT_co" , bound = inexact , covariant = True )
634
632
_NumberT = TypeVar ("_NumberT" , bound = number )
635
633
_CharT = TypeVar ("_CharT" , bound = character )
636
634
@@ -653,6 +651,8 @@ _TD64ItemT_co = TypeVar("_TD64ItemT_co", bound=dt.timedelta | int | None, defaul
653
651
_DT64ItemT_co = TypeVar ("_DT64ItemT_co" , bound = dt .date | int | None , default = dt .date | int | None , covariant = True )
654
652
_TD64UnitT = TypeVar ("_TD64UnitT" , bound = _TD64Unit , default = _TD64Unit )
655
653
654
+ _FloatSizeT_co = TypeVar ("_FloatSizeT_co" , bound = L [2 , 4 , 8 , 12 , 16 ], covariant = True )
655
+
656
656
###
657
657
# Type Aliases (for internal use only)
658
658
@@ -4328,14 +4328,6 @@ bool = bool_
4328
4328
4329
4329
# TODO(jorenham): Move these protocols to _numtype
4330
4330
4331
- @type_check_only
4332
- class _CanNEP50Float (Protocol [_InexactT_co ]):
4333
- def __nep50_float__ (self , / ) -> _InexactT_co : ...
4334
-
4335
- @type_check_only
4336
- class _CanNEP50Complex (Protocol [_ComplexFloatingT_co ]):
4337
- def __nep50_complex__ (self , / ) -> _ComplexFloatingT_co : ...
4338
-
4339
4331
class number (
4340
4332
_CmpOpMixin [_nt .CoComplex_0d , _nt .CoComplex_1nd ],
4341
4333
generic [_NumberItemT_co ],
@@ -4368,95 +4360,95 @@ class number(
4368
4360
@overload
4369
4361
def __add__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4370
4362
@overload
4371
- def __add__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4363
+ def __add__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4372
4364
@overload
4373
- def __add__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4365
+ def __add__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4374
4366
@overload
4375
4367
def __add__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ...
4376
4368
4377
4369
# keep in sync with __add__
4378
4370
@overload
4379
4371
def __radd__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4380
4372
@overload
4381
- def __radd__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4373
+ def __radd__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4382
4374
@overload
4383
- def __radd__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4375
+ def __radd__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4384
4376
@overload
4385
4377
def __radd__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ...
4386
4378
4387
4379
# keep in sync with __add__
4388
4380
@overload
4389
4381
def __sub__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4390
4382
@overload
4391
- def __sub__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4383
+ def __sub__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4392
4384
@overload
4393
- def __sub__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4385
+ def __sub__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4394
4386
@overload
4395
4387
def __sub__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ...
4396
4388
4397
4389
# keep in sync with __add__
4398
4390
@overload
4399
4391
def __rsub__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4400
4392
@overload
4401
- def __rsub__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4393
+ def __rsub__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4402
4394
@overload
4403
- def __rsub__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4395
+ def __rsub__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4404
4396
@overload
4405
4397
def __rsub__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ...
4406
4398
4407
4399
# keep in sync with __add__
4408
4400
@overload
4409
4401
def __mul__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4410
4402
@overload
4411
- def __mul__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4403
+ def __mul__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4412
4404
@overload
4413
- def __mul__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4405
+ def __mul__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4414
4406
@overload
4415
4407
def __mul__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ...
4416
4408
4417
4409
# keep in sync with __add__
4418
4410
@overload
4419
4411
def __rmul__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4420
4412
@overload
4421
- def __rmul__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4413
+ def __rmul__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4422
4414
@overload
4423
- def __rmul__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4415
+ def __rmul__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4424
4416
@overload
4425
4417
def __rmul__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], / ) -> _ScalarT : ...
4426
4418
4427
4419
# keep in sync with __add__
4428
4420
@overload
4429
4421
def __pow__ (self , x : _nt .CanCast0D [Self ] | int , mod : None = None , / ) -> Self : ...
4430
4422
@overload
4431
- def __pow__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , mod : None = None , / ) -> _InexactT : ...
4423
+ def __pow__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , mod : None = None , / ) -> _InexactT : ...
4432
4424
@overload
4433
- def __pow__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , mod : None = None , / ) -> _ComplexFloatingT : ...
4425
+ def __pow__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , mod : None = None , / ) -> _ComplexFloatingT : ...
4434
4426
@overload
4435
4427
def __pow__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], mod : None = None , / ) -> _ScalarT : ...
4436
4428
4437
4429
# keep in sync with __add__
4438
4430
@overload
4439
4431
def __rpow__ (self , x : _nt .CanCast0D [Self ] | int , mod : None = None , / ) -> Self : ...
4440
4432
@overload
4441
- def __rpow__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , mod : None = None , / ) -> _InexactT : ...
4433
+ def __rpow__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , mod : None = None , / ) -> _InexactT : ...
4442
4434
@overload
4443
- def __rpow__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , mod : None = None , / ) -> _ComplexFloatingT : ...
4435
+ def __rpow__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , mod : None = None , / ) -> _ComplexFloatingT : ...
4444
4436
@overload
4445
4437
def __rpow__ (self , x : _nt .PromoteWith0D [Self , _ScalarT ], mod : None = None , / ) -> _ScalarT : ...
4446
4438
4447
4439
#
4448
4440
@overload
4449
4441
def __truediv__ (self , x : _nt .CoFloating_0d | _nt .CanCast0D [Self ] | _nt .Just [number ], / ) -> inexact : ...
4450
4442
@overload
4451
- def __truediv__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4443
+ def __truediv__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4452
4444
@overload
4453
4445
def __truediv__ (self , x : _nt .PromoteWith0D [Self , _InexactT ], / ) -> _InexactT : ...
4454
4446
4455
4447
#
4456
4448
@overload
4457
4449
def __rtruediv__ (self , x : _nt .CoFloating_0d | _nt .CanCast0D [Self ] | _nt .Just [number ], / ) -> inexact : ...
4458
4450
@overload
4459
- def __rtruediv__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4451
+ def __rtruediv__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4460
4452
@overload
4461
4453
def __rtruediv__ (self , x : _nt .PromoteWith0D [Self , _InexactT ], / ) -> _InexactT : ...
4462
4454
@@ -4516,44 +4508,44 @@ class integer(_IntegralMixin, _RoundMixin, number[_BitT, int]):
4516
4508
@overload
4517
4509
def __floordiv__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4518
4510
@overload
4519
- def __floordiv__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4511
+ def __floordiv__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4520
4512
@overload
4521
4513
def __floordiv__ (self , x : _nt .PromoteWith0D [Self , _RealScalarT ], / ) -> _RealScalarT : ...
4522
4514
#
4523
4515
@overload
4524
4516
def __rfloordiv__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4525
4517
@overload
4526
- def __rfloordiv__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4518
+ def __rfloordiv__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4527
4519
@overload
4528
4520
def __rfloordiv__ (self , x : _nt .PromoteWith0D [Self , _RealScalarT ], / ) -> _RealScalarT : ...
4529
4521
4530
4522
#
4531
4523
@overload
4532
4524
def __mod__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4533
4525
@overload
4534
- def __mod__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4526
+ def __mod__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4535
4527
@overload
4536
4528
def __mod__ (self , x : _nt .PromoteWith0D [Self , _RealScalarT ], / ) -> _RealScalarT : ...
4537
4529
#
4538
4530
@overload
4539
4531
def __rmod__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> Self : ...
4540
4532
@overload
4541
- def __rmod__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4533
+ def __rmod__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _InexactT : ...
4542
4534
@overload
4543
4535
def __rmod__ (self , x : _nt .PromoteWith0D [Self , _RealScalarT ], / ) -> _RealScalarT : ...
4544
4536
4545
4537
#
4546
4538
@overload
4547
4539
def __divmod__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> _2Tuple [Self ]: ...
4548
4540
@overload
4549
- def __divmod__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _2Tuple [_InexactT ]: ...
4541
+ def __divmod__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _2Tuple [_InexactT ]: ...
4550
4542
@overload
4551
4543
def __divmod__ (self , x : _nt .PromoteWith0D [Self , _RealScalarT ], / ) -> _2Tuple [_RealScalarT ]: ...
4552
4544
#
4553
4545
@overload
4554
4546
def __rdivmod__ (self , x : _nt .CanCast0D [Self ] | int , / ) -> _2Tuple [Self ]: ...
4555
4547
@overload
4556
- def __rdivmod__ (self : _CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _2Tuple [_InexactT ]: ...
4548
+ def __rdivmod__ (self : _nt . CanNEP50Float [_InexactT ], x : _nt .JustFloat , / ) -> _2Tuple [_InexactT ]: ...
4557
4549
@overload
4558
4550
def __rdivmod__ (self , x : _nt .PromoteWith0D [Self , _RealScalarT ], / ) -> _2Tuple [_RealScalarT ]: ...
4559
4551
@@ -4988,14 +4980,14 @@ class inexact(number[_BitT, _InexactItemT_co], Generic[_BitT, _InexactItemT_co])
4988
4980
@overload
4989
4981
def __truediv__ (self , x : int | _nt .JustFloat | _nt .CanCast0D [Self ], / ) -> Self : ...
4990
4982
@overload
4991
- def __truediv__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4983
+ def __truediv__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4992
4984
@overload
4993
4985
def __truediv__ (self , x : _nt .PromoteWith0D [Self , _InexactT ], / ) -> _InexactT : ... # pyright: ignore[reportIncompatibleMethodOverride]
4994
4986
#
4995
4987
@overload
4996
4988
def __rtruediv__ (self , x : int | _nt .JustFloat | _nt .CanCast0D [Self ], / ) -> Self : ...
4997
4989
@overload
4998
- def __rtruediv__ (self : _CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4990
+ def __rtruediv__ (self : _nt . CanNEP50Complex [_ComplexFloatingT ], x : _nt .JustComplex , / ) -> _ComplexFloatingT : ...
4999
4991
@overload
5000
4992
def __rtruediv__ (self , x : _nt .PromoteWith0D [Self , _InexactT ], / ) -> _InexactT : ... # pyright: ignore[reportIncompatibleMethodOverride]
5001
4993
@@ -5050,16 +5042,12 @@ class floating(_RealMixin, _RoundMixin, inexact[_BitT, float]):
5050
5042
@overload
5051
5043
def __rdivmod__ (self , x : _nt .PromoteWith0D [Self , _FloatingT ], / ) -> _2Tuple [_FloatingT ]: ...
5052
5044
5053
- _FloatSizeT_co = TypeVar ("_FloatSizeT_co" , bound = L [2 , 4 , 8 , 12 , 16 ], covariant = True )
5054
-
5055
5045
@type_check_only
5056
5046
class _FloatMixin (Generic [_FloatSizeT_co ]):
5057
5047
@property
5058
5048
def itemsize (self ) -> _FloatSizeT_co : ...
5059
5049
@property
5060
5050
def nbytes (self ) -> _FloatSizeT_co : ...
5061
-
5062
- #
5063
5051
@override
5064
5052
def __hash__ (self , / ) -> int : ...
5065
5053
def is_integer (self , / ) -> py_bool : ...
0 commit comments