heapq

Standard library module View source
function heappush
heappush(heap: List[T], item: T, T: type)
function heappop
heappop(heap: List[T], T: type)
function heapreplace
heapreplace(heap: List[T], item: T, T: type)
function heappushpop
heappushpop(heap: List[T], item: T, T: type)
function heapify
heapify(x: List[T], T: type)
function nsmallest
nsmallest(n: int, iterable: Generator[T], key = Optional[int](), T: type)
function nlargest
nlargest(n: int, iterable: Generator[T], key = Optional[int](), T: type)
function merge
merge(*iterables, key = Optional[int](), reverse: bool = False)