From 0252202124186a806f9217eef0d559c31554c87d Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Tue, 12 Jul 2022 22:15:05 +0100 Subject: [PATCH 1/2] `fractions.pyi`: Correct dunder parameter names --- stdlib/fractions.pyi | 112 +++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/stdlib/fractions.pyi b/stdlib/fractions.pyi index fb64c659224a..e05f59e3d191 100644 --- a/stdlib/fractions.pyi +++ b/stdlib/fractions.pyi @@ -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 From 3f45416011def7f047f630fd9a15eb525b6ba7d4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 12 Jul 2022 21:18:04 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- test_cases/stdlib/builtins/test_tuple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_cases/stdlib/builtins/test_tuple.py b/test_cases/stdlib/builtins/test_tuple.py index d5e7516bc7a9..bf066feb2a60 100644 --- a/test_cases/stdlib/builtins/test_tuple.py +++ b/test_cases/stdlib/builtins/test_tuple.py @@ -1,5 +1,5 @@ -from typing_extensions import assert_type from typing import Tuple +from typing_extensions import assert_type # Empty tuples, see #8275