Stubtest fixes (#5249)

This commit is contained in:
hatal175
2021-04-26 07:56:54 +03:00
committed by GitHub
parent 761bd6e6b4
commit d151d1b8bb
3 changed files with 23 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Dict, Generic, List, Optional, Tuple, Type, TypeVar, Union, overload
from typing import Any, Dict, Generic, List, NoReturn, Optional, Tuple, Type, TypeVar, Union, overload
if sys.version_info >= (3, 10):
from typing import (
@@ -190,7 +190,6 @@ class deque(MutableSequence[_T], Generic[_T]):
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...
def __str__(self) -> str: ...
def __hash__(self) -> int: ...
# These methods of deque don't really take slices, but we need to
# define them as taking a slice to satisfy MutableSequence.
@overload
@@ -222,6 +221,8 @@ class Counter(Dict[_T, int], Generic[_T]):
def copy(self: _S) -> _S: ...
def elements(self) -> Iterator[_T]: ...
def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ...
@classmethod
def fromkeys(cls, iterable: Any, v: Optional[int] = ...) -> NoReturn: ... # type: ignore
@overload
def subtract(self, __iterable: None = ...) -> None: ...
@overload
@@ -291,10 +292,9 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
def copy(self: _S) -> _S: ...
class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
maps: List[Mapping[_KT, _VT]]
def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ...
@property
def maps(self) -> List[Mapping[_KT, _VT]]: ...
def new_child(self, m: Mapping[_KT, _VT] = ...) -> ChainMap[_KT, _VT]: ...
def new_child(self, m: Optional[Mapping[_KT, _VT]] = ...) -> ChainMap[_KT, _VT]: ...
@property
def parents(self) -> ChainMap[_KT, _VT]: ...
def __setitem__(self, k: _KT, v: _VT) -> None: ...