@@ -4134,6 +4134,9 @@ float32: TypeAlias = floating[_32Bit]
41344134
41354135# either a C `double`, `float`, or `longdouble`
41364136class float64 (floating [_64Bit ], float ): # type: ignore[misc]
4137+ def __new__ (cls , x : _ConvertibleToFloat | None = ..., / ) -> Self : ...
4138+
4139+ #
41374140 @property
41384141 def itemsize (self ) -> L [8 ]: ...
41394142 @property
@@ -4268,7 +4271,15 @@ longdouble: TypeAlias = floating[_NBitLongDouble]
42684271# describing the two 64 bit floats representing its real and imaginary component
42694272
42704273class complexfloating (inexact [_NBit1 , complex ], Generic [_NBit1 , _NBit2 ]):
4271- def __init__ (self , value : _ConvertibleToComplex | None = ..., / ) -> None : ...
4274+ @overload
4275+ def __init__ (
4276+ self ,
4277+ real : complex | SupportsComplex | SupportsFloat | SupportsIndex = ...,
4278+ imag : complex | SupportsFloat | SupportsIndex = ...,
4279+ / ,
4280+ ) -> None : ...
4281+ @overload
4282+ def __init__ (self , real : _ConvertibleToComplex | None = ..., / ) -> None : ...
42724283
42734284 @property
42744285 def real (self ) -> floating [_NBit1 ]: ... # type: ignore[override]
@@ -4352,6 +4363,17 @@ class complexfloating(inexact[_NBit1, complex], Generic[_NBit1, _NBit2]):
43524363complex64 : TypeAlias = complexfloating [_32Bit , _32Bit ]
43534364
43544365class complex128 (complexfloating [_64Bit , _64Bit ], complex ): # type: ignore[misc]
4366+ @overload
4367+ def __new__ (
4368+ cls ,
4369+ real : complex | SupportsComplex | SupportsFloat | SupportsIndex = ...,
4370+ imag : complex | SupportsFloat | SupportsIndex = ...,
4371+ / ,
4372+ ) -> Self : ...
4373+ @overload
4374+ def __new__ (cls , real : _ConvertibleToComplex | None = ..., / ) -> Self : ...
4375+
4376+ #
43554377 @property
43564378 def itemsize (self ) -> L [16 ]: ...
43574379 @property
@@ -4706,12 +4728,26 @@ class character(flexible[_CharacterItemT_co], Generic[_CharacterItemT_co]):
47064728
47074729class bytes_ (character [bytes ], bytes ):
47084730 @overload
4709- def __init__ (self , value : object = ..., / ) -> None : ...
4731+ def __new__ (cls , o : object = ..., / ) -> Self : ...
4732+ @overload
4733+ def __new__ (cls , s : str , / , encoding : str , errors : str = ...) -> Self : ...
4734+
4735+ #
4736+ @overload
4737+ def __init__ (self , o : object = ..., / ) -> None : ...
47104738 @overload
4711- def __init__ (self , value : str , / , encoding : str = ..., errors : str = ...) -> None : ...
4739+ def __init__ (self , s : str , / , encoding : str , errors : str = ...) -> None : ...
4740+
4741+ #
47124742 def __bytes__ (self , / ) -> bytes : ...
47134743
47144744class str_ (character [str ], str ):
4745+ @overload
4746+ def __new__ (cls , value : object = ..., / ) -> Self : ...
4747+ @overload
4748+ def __new__ (cls , value : bytes , / , encoding : str = ..., errors : str = ...) -> Self : ...
4749+
4750+ #
47154751 @overload
47164752 def __init__ (self , value : object = ..., / ) -> None : ...
47174753 @overload
0 commit comments