Skip to content
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
112 changes: 56 additions & 56 deletions stdlib/fractions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,112 +37,112 @@ class Fraction(Rational):
def as_integer_ratio(self) -> tuple[int, int]: ...

@property
def numerator(self) -> int: ...
def numerator(a) -> int: ...
@property
def denominator(self) -> int: ...
def denominator(a) -> int: ...
@overload
def __add__(self, b: int | Fraction) -> Fraction: ...
def __add__(a, b: int | Fraction) -> Fraction: ...
@overload
def __add__(self, b: float) -> float: ...
def __add__(a, b: float) -> float: ...
@overload
def __add__(self, b: complex) -> complex: ...
def __add__(a, b: complex) -> complex: ...
@overload
def __radd__(self, a: int | Fraction) -> Fraction: ...
def __radd__(b, a: int | Fraction) -> Fraction: ...
@overload
def __radd__(self, a: float) -> float: ...
def __radd__(b, a: float) -> float: ...
@overload
def __radd__(self, a: complex) -> complex: ...
def __radd__(b, a: complex) -> complex: ...
@overload
def __sub__(self, b: int | Fraction) -> Fraction: ...
def __sub__(a, b: int | Fraction) -> Fraction: ...
@overload
def __sub__(self, b: float) -> float: ...
def __sub__(a, b: float) -> float: ...
@overload
def __sub__(self, b: complex) -> complex: ...
def __sub__(a, b: complex) -> complex: ...
@overload
def __rsub__(self, a: int | Fraction) -> Fraction: ...
def __rsub__(b, a: int | Fraction) -> Fraction: ...
@overload
def __rsub__(self, a: float) -> float: ...
def __rsub__(b, a: float) -> float: ...
@overload
def __rsub__(self, a: complex) -> complex: ...
def __rsub__(b, a: complex) -> complex: ...
@overload
def __mul__(self, b: int | Fraction) -> Fraction: ...
def __mul__(a, b: int | Fraction) -> Fraction: ...
@overload
def __mul__(self, b: float) -> float: ...
def __mul__(a, b: float) -> float: ...
@overload
def __mul__(self, b: complex) -> complex: ...
def __mul__(a, b: complex) -> complex: ...
@overload
def __rmul__(self, a: int | Fraction) -> Fraction: ...
def __rmul__(b, a: int | Fraction) -> Fraction: ...
@overload
def __rmul__(self, a: float) -> float: ...
def __rmul__(b, a: float) -> float: ...
@overload
def __rmul__(self, a: complex) -> complex: ...
def __rmul__(b, a: complex) -> complex: ...
@overload
def __truediv__(self, b: int | Fraction) -> Fraction: ...
def __truediv__(a, b: int | Fraction) -> Fraction: ...
@overload
def __truediv__(self, b: float) -> float: ...
def __truediv__(a, b: float) -> float: ...
@overload
def __truediv__(self, b: complex) -> complex: ...
def __truediv__(a, b: complex) -> complex: ...
@overload
def __rtruediv__(self, a: int | Fraction) -> Fraction: ...
def __rtruediv__(b, a: int | Fraction) -> Fraction: ...
@overload
def __rtruediv__(self, a: float) -> float: ...
def __rtruediv__(b, a: float) -> float: ...
@overload
def __rtruediv__(self, a: complex) -> complex: ...
def __rtruediv__(b, a: complex) -> complex: ...
@overload
def __floordiv__(self, b: int | Fraction) -> int: ...
def __floordiv__(a, b: int | Fraction) -> int: ...
@overload
def __floordiv__(self, b: float) -> float: ...
def __floordiv__(a, b: float) -> float: ...
@overload
def __rfloordiv__(self, a: int | Fraction) -> int: ...
def __rfloordiv__(b, a: int | Fraction) -> int: ...
@overload
def __rfloordiv__(self, a: float) -> float: ...
def __rfloordiv__(b, a: float) -> float: ...
@overload
def __mod__(self, b: int | Fraction) -> Fraction: ...
def __mod__(a, b: int | Fraction) -> Fraction: ...
@overload
def __mod__(self, b: float) -> float: ...
def __mod__(a, b: float) -> float: ...
@overload
def __rmod__(self, a: int | Fraction) -> Fraction: ...
def __rmod__(b, a: int | Fraction) -> Fraction: ...
@overload
def __rmod__(self, a: float) -> float: ...
def __rmod__(b, a: float) -> float: ...
@overload
def __divmod__(self, b: int | Fraction) -> tuple[int, Fraction]: ...
def __divmod__(a, b: int | Fraction) -> tuple[int, Fraction]: ...
@overload
def __divmod__(self, b: float) -> tuple[float, Fraction]: ...
def __divmod__(a, b: float) -> tuple[float, Fraction]: ...
@overload
def __rdivmod__(self, a: int | Fraction) -> tuple[int, Fraction]: ...
def __rdivmod__(b, a: int | Fraction) -> tuple[int, Fraction]: ...
@overload
def __rdivmod__(self, a: float) -> tuple[float, Fraction]: ...
def __rdivmod__(b, a: float) -> tuple[float, Fraction]: ...
@overload
def __pow__(self, b: int) -> Fraction: ...
def __pow__(a, b: int) -> Fraction: ...
@overload
def __pow__(self, b: float | Fraction) -> float: ...
def __pow__(a, b: float | Fraction) -> float: ...
@overload
def __pow__(self, b: complex) -> complex: ...
def __pow__(a, b: complex) -> complex: ...
@overload
def __rpow__(self, a: float | Fraction) -> float: ...
def __rpow__(b, a: float | Fraction) -> float: ...
@overload
def __rpow__(self, a: complex) -> complex: ...
def __pos__(self) -> Fraction: ...
def __neg__(self) -> Fraction: ...
def __abs__(self) -> Fraction: ...
def __trunc__(self) -> int: ...
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...
def __rpow__(b, a: complex) -> complex: ...
def __pos__(a) -> Fraction: ...
def __neg__(a) -> Fraction: ...
def __abs__(a) -> Fraction: ...
def __trunc__(a) -> int: ...
def __floor__(a) -> int: ...
def __ceil__(a) -> int: ...
@overload
def __round__(self, ndigits: None = ...) -> int: ...
@overload
def __round__(self, ndigits: int) -> Fraction: ...
def __hash__(self) -> int: ...
def __eq__(self, b: object) -> bool: ...
def __lt__(self, b: _ComparableNum) -> bool: ...
def __gt__(self, b: _ComparableNum) -> bool: ...
def __le__(self, b: _ComparableNum) -> bool: ...
def __ge__(self, b: _ComparableNum) -> bool: ...
def __bool__(self) -> bool: ...
def __eq__(a, b: object) -> bool: ...
def __lt__(a, b: _ComparableNum) -> bool: ...
def __gt__(a, b: _ComparableNum) -> bool: ...
def __le__(a, b: _ComparableNum) -> bool: ...
def __ge__(a, b: _ComparableNum) -> bool: ...
def __bool__(a) -> bool: ...
def __copy__(self: Self) -> Self: ...
def __deepcopy__(self: Self, memo: Any) -> Self: ...
if sys.version_info >= (3, 11):
def __int__(self, _index: Callable[[SupportsIndex], int] = ...) -> int: ...
def __int__(a, _index: Callable[[SupportsIndex], int] = ...) -> int: ...
# Not actually defined within fractions.py, but provides more useful
# overrides
@property
Expand Down
2 changes: 1 addition & 1 deletion test_cases/stdlib/builtins/test_tuple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing_extensions import assert_type
from typing import Tuple
from typing_extensions import assert_type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, I wonder how this passed on my PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It surprised me too :)



# Empty tuples, see #8275
Expand Down