From acebd50eee689510e217352cee1c9a15ac4e3087 Mon Sep 17 00:00:00 2001 From: Stephen Morton Date: Sat, 14 Dec 2024 06:13:00 -0800 Subject: [PATCH] adjusting overload of `fractions.Fraction.__new__` (#13241) --- stdlib/@tests/stubtest_allowlists/common.txt | 1 - stdlib/fractions.pyi | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 6c3e3086f9e4..c3c91f07705f 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -16,7 +16,6 @@ contextlib._GeneratorContextManagerBase.__init__ # skipped in the stubs in favo ctypes.CDLL._FuncPtr # None at class level but initialized in __init__ to this value ctypes.memmove # CFunctionType ctypes.memset # CFunctionType -fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve http.client.HTTPConnection.response_class # the actual type at runtime is abc.ABCMeta importlib.abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility importlib.abc.MetaPathFinder.find_spec # Not defined on the actual class, but expected to exist. diff --git a/stdlib/fractions.pyi b/stdlib/fractions.pyi index fbcfa868cc1b..33bc766df15d 100644 --- a/stdlib/fractions.pyi +++ b/stdlib/fractions.pyi @@ -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: ...