mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-01 13:40:23 +08:00
Add from_number for float, complex, and Fraction (3.14) (#14091)
This commit is contained in:
@@ -400,6 +400,9 @@ class float:
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@classmethod
|
||||
def from_number(cls, number: float | SupportsIndex | SupportsFloat, /) -> Self: ...
|
||||
|
||||
class complex:
|
||||
# Python doesn't currently accept SupportsComplex for the second argument
|
||||
@@ -435,6 +438,9 @@ class complex:
|
||||
def __bool__(self) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __complex__(self) -> complex: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@classmethod
|
||||
def from_number(cls, number: complex | SupportsComplex | SupportsFloat | SupportsIndex, /) -> Self: ...
|
||||
|
||||
class _FormatMapMapping(Protocol):
|
||||
def __getitem__(self, key: str, /) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user