Skip to content

Commit 2279c87

Browse files
authored
collections: fix some Counter nits (#7313)
1 parent 690864c commit 2279c87

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/collections/__init__.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,12 @@ class Counter(dict[_T, int], Generic[_T]):
277277
def update(self, __m: Iterable[_T] | Iterable[tuple[_T, int]], **kwargs: int) -> None: ...
278278
@overload
279279
def update(self, __m: None = ..., **kwargs: int) -> None: ...
280+
def __missing__(self, key: _T) -> int: ...
280281
def __delitem__(self, elem: object) -> None: ...
281-
def __eq__(self, other: object) -> bool: ...
282-
def __ne__(self, other: object) -> bool: ...
282+
if sys.version_info >= (3, 10):
283+
def __eq__(self, other: object) -> bool: ...
284+
def __ne__(self, other: object) -> bool: ...
285+
283286
def __add__(self, other: Counter[_T]) -> Counter[_T]: ...
284287
def __sub__(self, other: Counter[_T]) -> Counter[_T]: ...
285288
def __and__(self, other: Counter[_T]) -> Counter[_T]: ...

0 commit comments

Comments
 (0)