mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
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:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user