stdlib: Add many missing dunder overrides (#7231)

This commit is contained in:
Alex Waygood
2022-02-16 14:25:47 +00:00
committed by GitHub
parent 409beea616
commit fbc279e3f5
28 changed files with 62 additions and 6 deletions

View File

@@ -82,6 +82,7 @@ class UserList(MutableSequence[_T]):
def __le__(self, other: list[_T] | UserList[_T]) -> bool: ...
def __gt__(self, other: list[_T] | UserList[_T]) -> bool: ...
def __ge__(self, other: list[_T] | UserList[_T]) -> bool: ...
def __eq__(self, other: object) -> bool: ...
def __contains__(self, item: object) -> bool: ...
def __len__(self) -> int: ...
@overload
@@ -125,6 +126,7 @@ class UserString(Sequence[UserString]):
def __le__(self, string: str | UserString) -> bool: ...
def __gt__(self, string: str | UserString) -> bool: ...
def __ge__(self, string: str | UserString) -> bool: ...
def __eq__(self, string: object) -> bool: ...
def __contains__(self, char: object) -> bool: ...
def __len__(self) -> int: ...
def __getitem__(self: Self, i: SupportsIndex | slice) -> Self: ...
@@ -267,6 +269,9 @@ class Counter(dict[_T, int], Generic[_T]):
def update(self, __m: Iterable[_T] | Iterable[tuple[_T, int]], **kwargs: int) -> None: ...
@overload
def update(self, __m: None = ..., **kwargs: int) -> None: ...
def __delitem__(self, elem: object) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __add__(self, other: Counter[_T]) -> Counter[_T]: ...
def __sub__(self, other: Counter[_T]) -> Counter[_T]: ...
def __and__(self, other: Counter[_T]) -> Counter[_T]: ...
@@ -362,6 +367,7 @@ class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def __getitem__(self, k: _KT) -> _VT: ...
def __iter__(self) -> Iterator[_KT]: ...
def __len__(self) -> int: ...
def __contains__(self, key: object) -> bool: ...
def __missing__(self, key: _KT) -> _VT: ... # undocumented
def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ...
@overload