from _typeshed import SupportsLessThan
from typing import Callable, Iterable, TypeVar

_T = TypeVar("_T")

def cmp_lt(x, y) -> bool: ...
def heappush(heap: list[_T], item: _T) -> None: ...
def heappop(heap: list[_T]) -> _T: ...
def heappushpop(heap: list[_T], item: _T) -> _T: ...
def heapify(x: list[_T]) -> None: ...
def heapreplace(heap: list[_T], item: _T) -> _T: ...
def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ...
def nlargest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> list[_T]: ...
def nsmallest(n: int, iterable: Iterable[_T], key: Callable[[_T], SupportsLessThan] | None = ...) -> list[_T]: ...
def _heapify_max(__x: list[_T]) -> None: ...  # undocumented
