diff --git a/stdlib/2and3/fractions.pyi b/stdlib/2and3/fractions.pyi index d66b63783..81d056a07 100644 --- a/stdlib/2and3/fractions.pyi +++ b/stdlib/2and3/fractions.pyi @@ -25,17 +25,13 @@ if sys.version_info < (3, 9): class Fraction(Rational): @overload - def __init__(self, - numerator: Union[int, Rational] = ..., - denominator: Optional[Union[int, Rational]] = ..., - *, - _normalize: bool = ...) -> None: ... + def __new__(cls, + numerator: Union[int, Rational] = ..., + denominator: Optional[Union[int, Rational]] = ..., + *, + _normalize: bool = ...) -> Fraction: ... @overload - def __init__(self, value: float, *, _normalize: bool = ...) -> None: ... - @overload - def __init__(self, value: Decimal, *, _normalize: bool = ...) -> None: ... - @overload - def __init__(self, value: str, *, _normalize: bool = ...) -> None: ... + def __new__(cls, __value: Union[float, Decimal, str], *, _normalize: bool = ...) -> Fraction: ... @classmethod def from_float(cls, f: float) -> Fraction: ... diff --git a/tests/stubtest_whitelists/py35.txt b/tests/stubtest_whitelists/py35.txt index 32f4e4121..844f9c827 100644 --- a/tests/stubtest_whitelists/py35.txt +++ b/tests/stubtest_whitelists/py35.txt @@ -23,6 +23,7 @@ collections.Reversible collections.UserString.maketrans ctypes.CDLL.__init__ decimal.Decimal.as_integer_ratio +fractions.Fraction.__new__ # private _normalize param was made keyword-only in Python 3.6 gettext.NullTranslations.npgettext gettext.NullTranslations.pgettext gettext.dnpgettext