8000 bump fractions.pyi to 3.14 by mkaraev · Pull Request #14070 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

bump fractions.pyi to 3.14 #14070

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

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
bump fraction.py to 3.14
  • Loading branch information
mkaraev committed May 28, 2025
commit a016357286d348fd9cd56d6057c62624c11f726a
39 changes: 28 additions & 11 deletions stdlib/fractions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sys
from collections.abc import Callable
from decimal import Decimal
from numbers import Rational, Real
from typing import Any, Literal, Optional, Protocol, SupportsIndex, overload
from typing import Any, Literal, Protocol, SupportsIndex, overload
from typing_extensions import Self, TypeAlias

_ComparableNum: TypeAlias = int | float | Decimal | Real
Expand Down Expand Up @@ -107,16 +107,33 @@ class Fraction(Rational):
def __rdivmod__(a, b: int | Fraction) -> tuple[int, Fraction]: ...
@overload
def __rdivmod__(a, b: float) -> tuple[float, Fraction]: ...
@overload
def __pow__(a, b: int, modulo: Optional[None] = None) -> Fraction: ...
@overload
def __pow__(a, b: float | Fraction, modulo: Optional[None] = None) -> float: ...
@overload
def __pow__(a, b: complex, modulo: Optional[None] = None) -> complex: ...
@overload
def __rpow__(b, a: float | Fraction, modulo: Optional[None] = None) -> float: ...
@overload
def __rpow__(b, a: complex, modulo: Optional[None] = None) -> complex: ...

if sys.version_info >= (3, 14):
@overload
def __pow__(a, b: int, modulo: None = None) -> Fraction: ...
@overload
def __pow__(a, b: float | Fraction, modulo: None = None) -> float: ...
@overload
def __pow__(a, b: complex, modulo: None = None) -> complex: ...
else:
@overload
def __pow__(a, b: int) -> Fraction: ...
@overload
def __pow__(a, b: float | Fraction) -> float: ...
@overload
def __pow__(a, b: complex) -> complex: ...

if sys.version_info >= (3, 14):
@overload
def __rpow__(b, a: float | Fraction, modulo: None = None) -> float: ...
@overload
def __rpow__(b, a: complex, modulo: None = None) -> complex: ...
else:
@overload
def __rpow__(b, a: float | Fraction) -> float: ...
@overload
def __rpow__(b, a: complex) -> complex: ...

def __pos__(a) -> Fraction: ...
def __neg__(a) -> Fraction: ...
def __abs__(a) -> Fraction: ...
Expand Down
0