mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
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:
@@ -1,7 +1,6 @@
|
||||
# Note: these stubs are incomplete. The more complex type
|
||||
# signatures are currently omitted.
|
||||
|
||||
import sys
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Any, Optional, SupportsFloat, overload
|
||||
|
||||
@@ -12,10 +11,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 __bool__(self) -> bool: ...
|
||||
@property
|
||||
@abstractmethod
|
||||
def real(self) -> Any: ...
|
||||
@@ -36,11 +32,6 @@ 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 __truediv__(self, other: Any) -> Any: ...
|
||||
@abstractmethod
|
||||
@@ -52,25 +43,22 @@ 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: ...
|
||||
|
||||
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: ...
|
||||
@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 +90,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 __int__(self) -> int: ...
|
||||
def __index__(self) -> int: ...
|
||||
@abstractmethod
|
||||
def __pow__(self, exponent: Any, modulus: Optional[Any] = ...) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user