title: In python, how should I implement a min heap on a list of tuple?
body: <p>I'm trying to implement a min heap on a list of tuple.
  For example:</p>
  
  <pre><code>A=[('a',2),('b',1)]
  </code></pre>
  
  <p>how can I heapify A based on the second element of these tuple, so that A will be heapified to <code>[('b',1),('a',2)]</code> ? (I must maintain a min heap.)</p>