title: What would you use the heapq Python module for in real life?
body: <p>After reading Guido's <a href="http://neopythonic.blogspot.com/2008/10/sorting-million-32-bit-integers-in-2mb.html" rel="noreferrer">Sorting a million 32-bit integers in 2MB of RAM using Python</a>, I discovered the <code>heapq</code> module, but the concept is pretty abstract to me.</p>
  
  <p>One reason is that I don't understand the concept of a heap completely, but I do understand how Guido used it.</p>
  
  <p>Now, beside his kinda crazy example, what would you use the <code>heapq</code> module for?</p>
  
  <p>Must it always be related to sorting or minimum value? Is it only something you use because it's faster than other approaches? Or can you do really elegant things that you can't do without?</p>