adjusting overload of fractions.Fraction.__new__ (#13241)

This commit is contained in:
Stephen Morton
2024-12-14 06:13:00 -08:00
committed by GitHub
parent 364fd7d18f
commit acebd50eee
2 changed files with 2 additions and 3 deletions

View File

@@ -27,11 +27,11 @@ class Fraction(Rational):
@overload
def __new__(cls, numerator: int | Rational = 0, denominator: int | Rational | None = None) -> Self: ...
@overload
def __new__(cls, value: float | Decimal | str, /) -> Self: ...
def __new__(cls, numerator: float | Decimal | str) -> Self: ...
if sys.version_info >= (3, 14):
@overload
def __new__(cls, value: _ConvertibleToIntegerRatio) -> Self: ...
def __new__(cls, numerator: _ConvertibleToIntegerRatio) -> Self: ...
@classmethod
def from_float(cls, f: float) -> Self: ...