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

@@ -9,8 +9,7 @@ _TypeCode = Union[_IntTypeCode, _FloatTypeCode, _UnicodeTypeCode]
_T = TypeVar("_T", int, float, Text)
if sys.version_info >= (3,):
typecodes: str
typecodes: str
class array(MutableSequence[_T], Generic[_T]):
typecode: _TypeCode
@@ -28,8 +27,7 @@ class array(MutableSequence[_T], Generic[_T]):
def byteswap(self) -> None: ...
def count(self, __v: Any) -> int: ...
def extend(self, __bb: Iterable[_T]) -> None: ...
if sys.version_info >= (3, 2):
def frombytes(self, __buffer: bytes) -> None: ...
def frombytes(self, __buffer: bytes) -> None: ...
def fromfile(self, __f: BinaryIO, __n: int) -> None: ...
def fromlist(self, __list: List[_T]) -> None: ...
def fromunicode(self, __ustr: str) -> None: ...
@@ -39,17 +37,12 @@ class array(MutableSequence[_T], Generic[_T]):
def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence
def insert(self, __i: int, __v: _T) -> None: ...
def pop(self, __i: int = ...) -> _T: ...
if sys.version_info < (3,):
def read(self, f: BinaryIO, n: int) -> None: ...
def remove(self, __v: Any) -> None: ...
def reverse(self) -> None: ...
if sys.version_info >= (3, 2):
def tobytes(self) -> bytes: ...
def tobytes(self) -> bytes: ...
def tofile(self, __f: BinaryIO) -> None: ...
def tolist(self) -> List[_T]: ...
def tounicode(self) -> str: ...
if sys.version_info < (3,):
def write(self, f: BinaryIO) -> None: ...
if sys.version_info < (3, 9):
def fromstring(self, __buffer: bytes) -> None: ...
def tostring(self) -> bytes: ...
@@ -72,9 +65,5 @@ class array(MutableSequence[_T], Generic[_T]):
def __lt__(self, other: array[_T]) -> bool: ...
def __mul__(self, n: int) -> array[_T]: ...
def __rmul__(self, n: int) -> array[_T]: ...
if sys.version_info < (3,):
def __delslice__(self, i: int, j: int) -> None: ...
def __getslice__(self, i: int, j: int) -> array[_T]: ...
def __setslice__(self, i: int, j: int, y: array[_T]) -> None: ...
ArrayType = array