title: What's the difference between heapq and PriorityQueue in python?
body: <p>In python there's a built-in <a href="https://docs.python.org/3/library/heapq.html" rel="noreferrer"><code>heapq</code></a> algorithm that gives you <code>push</code>, <code>pop</code>, <code>nlargest</code>, <code>nsmallest</code>... etc that you can apply to lists. However, there's also the <a href="https://docs.python.org/3/library/queue.html#queue.PriorityQueue" rel="noreferrer"><code>queue.PriorityQueue</code></a> class that seems to support more or less the same functionality. What's the difference, and when would you use one over the other?</p>