mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
clean python 3 specific stuff from stdlib/@python2 stubs (#5451)
This commit is contained in:
@@ -7,15 +7,14 @@ from typing_extensions import Literal
|
||||
_ComparableNum = Union[int, float, Decimal, Real]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
@overload
|
||||
def gcd(a: int, b: int) -> int: ...
|
||||
@overload
|
||||
def gcd(a: Integral, b: int) -> Integral: ...
|
||||
@overload
|
||||
def gcd(a: int, b: Integral) -> Integral: ...
|
||||
@overload
|
||||
def gcd(a: Integral, b: Integral) -> Integral: ...
|
||||
@overload
|
||||
def gcd(a: int, b: int) -> int: ...
|
||||
@overload
|
||||
def gcd(a: Integral, b: int) -> Integral: ...
|
||||
@overload
|
||||
def gcd(a: int, b: Integral) -> Integral: ...
|
||||
@overload
|
||||
def gcd(a: Integral, b: Integral) -> Integral: ...
|
||||
|
||||
class Fraction(Rational):
|
||||
@overload
|
||||
@@ -33,8 +32,6 @@ class Fraction(Rational):
|
||||
@classmethod
|
||||
def from_decimal(cls, dec: Decimal) -> Fraction: ...
|
||||
def limit_denominator(self, max_denominator: int = ...) -> Fraction: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def as_integer_ratio(self) -> Tuple[int, int]: ...
|
||||
@property
|
||||
def numerator(self) -> int: ...
|
||||
@property
|
||||
@@ -87,19 +84,18 @@ 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 __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 +134,13 @@ 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 __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 __nonzero__(self) -> bool: ...
|
||||
# Not actually defined within fractions.py, but provides more useful
|
||||
# overrides
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user