Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)

* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
Akuli
2021-05-15 15:33:39 +03:00
committed by GitHub
parent b0ef85288d
commit 17dcea4a68
106 changed files with 1539 additions and 3275 deletions

View File

@@ -87,19 +87,6 @@ class Fraction(Rational):
def __rtruediv__(self, other: float) -> float: ...
@overload
def __rtruediv__(self, other: complex) -> complex: ...
if sys.version_info < (3, 0):
@overload
def __div__(self, other: Union[int, Fraction]) -> Fraction: ...
@overload
def __div__(self, other: float) -> float: ...
@overload
def __div__(self, other: complex) -> complex: ...
@overload
def __rdiv__(self, other: Union[int, Fraction]) -> Fraction: ...
@overload
def __rdiv__(self, other: float) -> float: ...
@overload
def __rdiv__(self, other: complex) -> complex: ...
@overload
def __floordiv__(self, other: Union[int, Fraction]) -> int: ...
@overload
@@ -138,23 +125,19 @@ class Fraction(Rational):
def __neg__(self) -> Fraction: ...
def __abs__(self) -> Fraction: ...
def __trunc__(self) -> int: ...
if sys.version_info >= (3, 0):
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...
@overload
def __round__(self, ndigits: None = ...) -> int: ...
@overload
def __round__(self, ndigits: int) -> Fraction: ...
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...
@overload
def __round__(self, ndigits: None = ...) -> int: ...
@overload
def __round__(self, ndigits: int) -> Fraction: ...
def __hash__(self) -> int: ...
def __eq__(self, other: object) -> bool: ...
def __lt__(self, other: _ComparableNum) -> bool: ...
def __gt__(self, other: _ComparableNum) -> bool: ...
def __le__(self, other: _ComparableNum) -> bool: ...
def __ge__(self, other: _ComparableNum) -> bool: ...
if sys.version_info >= (3, 0):
def __bool__(self) -> bool: ...
else:
def __nonzero__(self) -> bool: ...
def __bool__(self) -> bool: ...
# Not actually defined within fractions.py, but provides more useful
# overrides
@property