clean python 3 specific stuff from stdlib/@python2 stubs (#5451)

This commit is contained in:
Akuli
2021-05-15 01:19:05 +03:00
committed by GitHub
parent f94d838814
commit 5ec4f06263
121 changed files with 1024 additions and 4801 deletions

View File

@@ -12,10 +12,7 @@ class Number(metaclass=ABCMeta):
class Complex(Number):
@abstractmethod
def __complex__(self) -> complex: ...
if sys.version_info >= (3, 0):
def __bool__(self) -> bool: ...
else:
def __nonzero__(self) -> bool: ...
def __nonzero__(self) -> bool: ...
@property
@abstractmethod
def real(self) -> Any: ...
@@ -36,11 +33,10 @@ class Complex(Number):
def __mul__(self, other: Any) -> Any: ...
@abstractmethod
def __rmul__(self, other: Any) -> Any: ...
if sys.version_info < (3, 0):
@abstractmethod
def __div__(self, other): ...
@abstractmethod
def __rdiv__(self, other): ...
@abstractmethod
def __div__(self, other): ...
@abstractmethod
def __rdiv__(self, other): ...
@abstractmethod
def __truediv__(self, other: Any) -> Any: ...
@abstractmethod
@@ -52,25 +48,13 @@ class Complex(Number):
def __abs__(self) -> Real: ...
def conjugate(self) -> Any: ...
def __eq__(self, other: Any) -> bool: ...
if sys.version_info < (3, 0):
def __ne__(self, other: Any) -> bool: ...
def __ne__(self, other: Any) -> bool: ...
class Real(Complex, SupportsFloat):
@abstractmethod
def __float__(self) -> float: ...
@abstractmethod
def __trunc__(self) -> int: ...
if sys.version_info >= (3, 0):
@abstractmethod
def __floor__(self) -> int: ...
@abstractmethod
def __ceil__(self) -> int: ...
@abstractmethod
@overload
def __round__(self, ndigits: None = ...) -> int: ...
@abstractmethod
@overload
def __round__(self, ndigits: int) -> Any: ...
def __divmod__(self, other: Any) -> Any: ...
def __rdivmod__(self, other: Any) -> Any: ...
@abstractmethod
@@ -102,12 +86,8 @@ class Rational(Real):
def __float__(self) -> float: ...
class Integral(Rational):
if sys.version_info >= (3, 0):
@abstractmethod
def __int__(self) -> int: ...
else:
@abstractmethod
def __long__(self) -> long: ...
@abstractmethod
def __long__(self) -> long: ...
def __index__(self) -> int: ...
@abstractmethod
def __pow__(self, exponent: Any, modulus: Optional[Any] = ...) -> Any: ...