From be7490322b02bb93e8cec129cca78264f5494260 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 19 Jul 2017 10:29:32 -0700 Subject: [PATCH] Counter: fix return value of most_common() (#1491) https://docs.python.org/3/library/collections.html#collections.Counter.most_common https://docs.python.org/2/library/collections.html#collections.Counter.most_common --- stdlib/2/collections.pyi | 2 +- stdlib/3/collections/__init__.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2/collections.pyi b/stdlib/2/collections.pyi index 1fab27443..e0d983ea6 100644 --- a/stdlib/2/collections.pyi +++ b/stdlib/2/collections.pyi @@ -67,7 +67,7 @@ class Counter(Dict[_T, int], Generic[_T]): @overload def __init__(self, iterable: Iterable[_T]) -> None: ... def elements(self) -> Iterator[_T]: ... - def most_common(self, n: int = ...) -> List[_T]: ... + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... @overload def subtract(self, __mapping: Mapping[_T, int]) -> None: ... @overload diff --git a/stdlib/3/collections/__init__.pyi b/stdlib/3/collections/__init__.pyi index e10d86183..fd6bfd824 100644 --- a/stdlib/3/collections/__init__.pyi +++ b/stdlib/3/collections/__init__.pyi @@ -125,7 +125,7 @@ class Counter(Dict[_T, int], Generic[_T]): def elements(self) -> Iterator[_T]: ... - def most_common(self, n: int = ...) -> List[_T]: ... + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... @overload def subtract(self, __mapping: Mapping[_T, int]) -> None: ...