Skip to content

Removed conditional import from _collections_abc within collections/_… #5040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 27, 2021
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 number Diff line number Diff 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 Down Expand 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 Down Expand 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