mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
clean python 3 specific stuff from stdlib/@python2 stubs (#5451)
This commit is contained in:
@@ -9,9 +9,6 @@ _TypeCode = Union[_IntTypeCode, _FloatTypeCode, _UnicodeTypeCode]
|
||||
|
||||
_T = TypeVar("_T", int, float, Text)
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
typecodes: str
|
||||
|
||||
class array(MutableSequence[_T], Generic[_T]):
|
||||
typecode: _TypeCode
|
||||
itemsize: int
|
||||
@@ -28,31 +25,21 @@ 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 fromfile(self, __f: BinaryIO, __n: int) -> None: ...
|
||||
def fromlist(self, __list: List[_T]) -> None: ...
|
||||
def fromunicode(self, __ustr: str) -> None: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def index(self, __v: _T, __start: int = ..., __stop: int = ...) -> int: ...
|
||||
else:
|
||||
def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence
|
||||
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 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 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: ...
|
||||
def write(self, f: BinaryIO) -> None: ...
|
||||
def fromstring(self, __buffer: bytes) -> None: ...
|
||||
def tostring(self) -> bytes: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> _T: ...
|
||||
@@ -72,9 +59,8 @@ 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: ...
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user