Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions stdlib/2/array.pyi

This file was deleted.

22 changes: 18 additions & 4 deletions stdlib/3/array.pyi → stdlib/2and3/array.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Stubs for array

# Based on http://docs.python.org/3.2/library/array.html
# Based on http://docs.python.org/3.6/library/array.html

import sys
from typing import (Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence,
overload, Text, Tuple, TypeVar, Union)

_T = TypeVar('_T', int, float, Text)

typecodes = ... # type: str
if sys.version_info >= (3,):
typecodes = ... # type: str

class array(MutableSequence[_T], Generic[_T]):
typecode = ... # type: str
Expand All @@ -19,21 +21,27 @@ class array(MutableSequence[_T], Generic[_T]):
def byteswap(self) -> None: ...
def count(self, x: Any) -> int: ...
def extend(self, iterable: Iterable[_T]) -> None: ...
def frombytes(self, s: bytes) -> None: ...
if sys.version_info >= (3, 2):
def frombytes(self, s: bytes) -> None: ...
def fromfile(self, f: BinaryIO, n: int) -> None: ...
def fromlist(self, list: List[_T]) -> None: ...
def fromstring(self, s: bytes) -> None: ...
def fromunicode(self, s: str) -> None: ...
def index(self, x: _T) -> int: ... # type: ignore # Overrides Sequence
def insert(self, i: int, x: _T) -> None: ...
def pop(self, i: int = ...) -> _T: ...
if sys.version_info < (3,):
def read(self, f: BinaryIO, n: int) -> None: ...
def remove(self, x: Any) -> None: ...
def reverse(self) -> None: ...
def tobytes(self) -> bytes: ...
if sys.version_info >= (3, 2):
def tobytes(self) -> bytes: ...
def tofile(self, f: BinaryIO) -> None: ...
def tolist(self) -> List[_T]: ...
def tostring(self) -> bytes: ...
def tounicode(self) -> str: ...
if sys.version_info < (3,):
def write(self, f: BinaryIO) -> None: ...

def __len__(self) -> int: ...

Expand All @@ -57,3 +65,9 @@ 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