title: heapq with custom compare predicate
body: <p>I am trying to build a heap with a custom sort predicate. Since the values going into it are of &quot;user-defined&quot; type, I cannot modify their built-in comparison predicate.</p>
  <p>Is there a way to do something like:</p>
  <pre><code>h = heapq.heapify([...], key=my_lt_pred)
  h = heapq.heappush(h, key=my_lt_pred)
  </code></pre>
  <p>Or even better, I could wrap the <code>heapq</code> functions in my own container so I don't need to keep passing the predicate.</p>