Add from_number for float, complex, and Fraction (3.14) (#14091)

This commit is contained in:
Max Muoto
2025-05-17 22:09:59 -07:00
committed by GitHub
parent 9430260770
commit 1c5164f069
3 changed files with 9 additions and 3 deletions
+3
View File
@@ -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: ...