mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-19 06:49:44 +08:00
Add type annotation for collections.deque.__iadd__ (#2774)
* Add type annotation for collections.deque.__iadd__ Fixes #2771.
This commit is contained in:
committed by
Sebastian Rittau
parent
caefaa6af9
commit
3eb66ba633
@@ -21,6 +21,7 @@ from typing import (
|
||||
ValuesView as ValuesView,
|
||||
)
|
||||
|
||||
_S = TypeVar('_S')
|
||||
_T = TypeVar('_T')
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
@@ -53,6 +54,7 @@ class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]):
|
||||
def __setitem__(self, i: int, x: _T) -> None: ...
|
||||
def __contains__(self, o: _T) -> bool: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ...
|
||||
|
||||
_CounterT = TypeVar('_CounterT', bound=Counter)
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ if sys.version_info >= (3, 5):
|
||||
AsyncIterator as AsyncIterator,
|
||||
)
|
||||
|
||||
_S = TypeVar('_S')
|
||||
_T = TypeVar('_T')
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
@@ -235,6 +236,8 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
|
||||
def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ...
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
def __add__(self, other: deque[_T]) -> deque[_T]: ...
|
||||
def __mul__(self, other: int) -> deque[_T]: ...
|
||||
|
||||
Reference in New Issue
Block a user