mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-23 17:28:38 +08:00
Add from_number for float, complex, and Fraction (3.14) (#14091)
This commit is contained in:
@@ -27,8 +27,6 @@ asyncio.tasks.eager_task_factory
|
||||
builtins.bytearray.resize
|
||||
builtins.classmethod.__annotate__
|
||||
builtins.classmethod.__class_getitem__
|
||||
builtins.complex.from_number
|
||||
builtins.float.from_number
|
||||
builtins.int.__round__
|
||||
builtins.memoryview.__class_getitem__
|
||||
builtins.staticmethod.__annotate__
|
||||
@@ -56,7 +54,6 @@ enum.EnumType.__signature__
|
||||
faulthandler.dump_c_stack
|
||||
fractions.Fraction.__pow__
|
||||
fractions.Fraction.__rpow__
|
||||
fractions.Fraction.from_number
|
||||
gzip.GzipFile.readinto
|
||||
gzip.GzipFile.readinto1
|
||||
gzip.compress
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -145,3 +145,6 @@ class Fraction(Rational):
|
||||
@property
|
||||
def imag(self) -> Literal[0]: ...
|
||||
def conjugate(self) -> Fraction: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@classmethod
|
||||
def from_number(cls, number: float | Rational | _ConvertibleToIntegerRatio) -> Self: ...
|
||||
|
||||
Reference in New Issue
Block a user