Remove version check for deque.insert and deque.index (#1916)

Otherwise, deque is not instantiable in Python 3.4. We could do a dynamic base class instead
but that doesn't seem worth it.
This commit is contained in:
Jelle Zijlstra
2018-02-24 11:12:56 -08:00
committed by GitHub
parent ab72267669
commit 35d3effe03

View File

@@ -183,7 +183,8 @@ class UserString(Sequence[str]):
def zfill(self: _UserStringT, width: int) -> _UserStringT: ...
# Technically, deque only derives from MutableSequence in 3.5.
# Technically, deque only derives from MutableSequence in 3.5 (before then, the insert and index
# methods did not exist).
# But in practice it's not worth losing sleep over.
class deque(MutableSequence[_T], Generic[_T]):
maxlen = ... # type: Optional[int] # TODO readonly
@@ -197,9 +198,8 @@ class deque(MutableSequence[_T], Generic[_T]):
def count(self, x: _T) -> int: ...
def extend(self, iterable: Iterable[_T]) -> None: ...
def extendleft(self, iterable: Iterable[_T]) -> None: ...
if sys.version_info >= (3, 5):
def insert(self, i: int, x: _T) -> None: ...
def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ...
def insert(self, i: int, x: _T) -> None: ...
def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ...
def pop(self, i: int = ...) -> _T: ...
def popleft(self) -> _T: ...
def remove(self, value: _T) -> None: ...