stdlib: Add several missing comparison methods (#7202)

This commit is contained in:
Alex Waygood
2022-02-14 19:09:52 +00:00
committed by GitHub
parent f3ad0179f8
commit 66a229b709
5 changed files with 37 additions and 1 deletions

View File

@@ -220,6 +220,10 @@ class deque(MutableSequence[_T], Generic[_T]):
def __add__(self: Self, __other: Self) -> Self: ...
def __mul__(self: Self, __other: int) -> Self: ...
def __imul__(self: Self, __other: int) -> Self: ...
def __lt__(self, __other: deque[_T]) -> bool: ...
def __le__(self, __other: deque[_T]) -> bool: ...
def __gt__(self, __other: deque[_T]) -> bool: ...
def __ge__(self, __other: deque[_T]) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
@@ -266,6 +270,10 @@ class Counter(dict[_T, int], Generic[_T]):
def __ior__(self: Self, other: Counter[_T]) -> Self: ... # type: ignore[override]
if sys.version_info >= (3, 10):
def total(self) -> int: ...
def __le__(self, other: Counter[object]) -> bool: ...
def __lt__(self, other: Counter[object]) -> bool: ...
def __ge__(self, other: Counter[object]) -> bool: ...
def __gt__(self, other: Counter[object]) -> bool: ...
@final
class _OrderedDictKeysView(dict_keys[_KT_co, _VT_co], Reversible[_KT_co]): # type: ignore[misc]