A heap keeps its smallest element at the root, but the rest of its list isn't a sorted report. Remove items with heappop when you need priority order. Equal priorities need a deliberate tie rule; an arrival index preserves first-in order without comparing unrelated domain objects. The selection helpers nlargest and nsmallest handle a bounded set of extremes.
Bisection solves a different problem. On a sorted sequence, bisect_left finds the insertion point before equals and bisect_right finds the point after them. Their difference counts duplicates, and paired boundaries count an inclusive window. The searches are logarithmic, while inserting into a Python list still shifts elements. You will test ties, absent targets, empty input, and equal window endpoints.