Skip to content

Commit acebd50

Browse files
authored
adjusting overload of fractions.Fraction.__new__ (#13241)
1 parent 364fd7d commit acebd50

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

stdlib/@tests/stubtest_allowlists/common.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ contextlib._GeneratorContextManagerBase.__init__ # skipped in the stubs in favo
1616
ctypes.CDLL._FuncPtr # None at class level but initialized in __init__ to this value
1717
ctypes.memmove # CFunctionType
1818
ctypes.memset # CFunctionType
19-
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
2019
http.client.HTTPConnection.response_class # the actual type at runtime is abc.ABCMeta
2120
importlib.abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
2221
importlib.abc.MetaPathFinder.find_spec # Not defined on the actual class, but expected to exist.

stdlib/fractions.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class Fraction(Rational):
2727
@overload
2828
def __new__(cls, numerator: int | Rational = 0, denominator: int | Rational | None = None) -> Self: ...
2929
@overload
30-
def __new__(cls, value: float | Decimal | str, /) -> Self: ...
30+
def __new__(cls, numerator: float | Decimal | str) -> Self: ...
3131

3232
if sys.version_info >= (3, 14):
3333
@overload
34-
def __new__(cls, value: _ConvertibleToIntegerRatio) -> Self: ...
34+
def __new__(cls, numerator: _ConvertibleToIntegerRatio) -> Self: ...
3535

3636
@classmethod
3737
def from_float(cls, f: float) -> Self: ...

0 commit comments

Comments
 (0)