@@ -462,6 +462,8 @@ class uint64(unsignedinteger):
462462class inexact (number ): ... # type: ignore
463463class floating (inexact , _real_generic ): ... # type: ignore
464464
465+ _FloatType = TypeVar ('_FloatType' , bound = floating )
466+
465467class float16 (floating ):
466468 def __init__ (self , __value : Optional [SupportsFloat ] = ...) -> None : ...
467469
@@ -471,27 +473,24 @@ class float32(floating):
471473class float64 (floating ):
472474 def __init__ (self , __value : Optional [SupportsFloat ] = ...) -> None : ...
473475
474- class complexfloating (inexact ): ... # type: ignore
476+ class complexfloating (inexact , Generic [_FloatType ]): # type: ignore
477+ @property
478+ def real (self ) -> _FloatType : ...
479+ @property
480+ def imag (self ) -> _FloatType : ...
481+ def __abs__ (self ) -> _FloatType : ... # type: ignore[override]
475482
476- class complex64 (complexfloating ):
483+ class complex64 (complexfloating [ float32 ] ):
477484 def __init__ (
478485 self ,
479486 __value : Union [None , SupportsInt , SupportsFloat , SupportsComplex ] = ...
480487 ) -> None : ...
481- @property
482- def real (self ) -> float32 : ...
483- @property
484- def imag (self ) -> float32 : ...
485488
486- class complex128 (complexfloating ):
489+ class complex128 (complexfloating [ float64 ] ):
487490 def __init__ (
488491 self ,
489492 __value : Union [None , SupportsInt , SupportsFloat , SupportsComplex ] = ...
490493 ) -> None : ...
491- @property
492- def real (self ) -> float64 : ...
493- @property
494- def imag (self ) -> float64 : ...
495494
496495class flexible (_real_generic ): ... # type: ignore
497496
0 commit comments