Skip to content
Merged
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
21 changes: 17 additions & 4 deletions stdlib/collections/__init__.pyi
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
import sys
import typing
from typing import Any, Dict, Generic, List, Optional, Tuple, Type, TypeVar, Union, overload

if sys.version_info < (3, 10):
from _collections_abc import *
else:
from typing import (
Callable,
ItemsView,
Iterable,
Iterator,
KeysView,
Mapping,
MutableMapping,
MutableSequence,
Reversible,
Sequence,
ValuesView,
)

_S = TypeVar("_S")
_T = TypeVar("_T")
Expand DownExpand Up@@ -103,7 +116,7 @@ class UserString(Sequence[str]):
def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...
def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...
if sys.version_info >= (3, 8):
def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> bytes: ...
def encode(self: UserString, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> bytes: ...
else:
def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ...
def endswith(self, suffix: Union[str, Tuple[str, ...]], start: Optional[int] = ..., end: Optional[int] = ...) -> bool: ...
Expand DownExpand Up@@ -281,9 +294,9 @@ class ChainMap(MutableMapping[_KT, _VT], Generic[_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] = ...) -> typing.ChainMap[_KT, _VT]: ...
def new_child(self, m: Mapping[_KT, _VT] = ...) -> ChainMap[_KT, _VT]: ...
@property
def parents(self) -> typing.ChainMap[_KT, _VT]: ...
def parents(self) -> ChainMap[_KT, _VT]: ...
def __setitem__(self, k: _KT, v: _VT) -> None: ...
def __delitem__(self, v: _KT) -> None: ...
def __getitem__(self, k: _KT) -> _VT: ...
Expand Down