diff --git a/builtins/2.7/_heapq.pyi b/builtins/2.7/_heapq.pyi index de1b446e3..8b7f6eac0 100644 --- a/builtins/2.7/_heapq.pyi +++ b/builtins/2.7/_heapq.pyi @@ -1,27 +1,15 @@ """Stub file for the '_heapq' module.""" -# This is an autogenerated file. It serves as a starting point -# for a more precise manual annotation of this module. -# Feel free to edit the source below, but remove this header when you do. -from typing import Any, List, Tuple, Dict, Generic +from typing import TypeVar, List -def heapify(*args, **kwargs) -> None: - raise TypeError() +_T = TypeVar("_T") -def heappop(*args, **kwargs) -> Any: - raise IndexError() - raise TypeError() - -def heappush(*args, **kwargs) -> None: - raise TypeError() - -def heappushpop(*args, **kwargs) -> Any: - raise TypeError() - -def heapreplace(*args, **kwargs) -> Any: - raise IndexError() - raise TypeError() - -def nlargest(a: int, b) -> List[object]: ... - -def nsmallest(a: int, b) -> List[object]: ... +def heapify(heap: List[_T]) -> None: ... +def heappop(heap: List[_T]) -> _T: + raise IndexError() # if list is empty +def heappush(heap: List[_T], item: _T) -> None: ... +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapreplace(heap: List[_T], item: _T) -> _T: + raise IndexError() # if list is empty +def nlargest(a: int, b: List[_T]) -> List[_T]: ... +def nsmallest(a: int, b: List[_T]) -> List[_T]: ...