Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjusting overload of fractions.Fraction.__new__ #13241

Merged
merged 2 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/fractions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
Loading