title: In Python, heapq.heapify doesn't take cmp or key functions as arguments like sorted does
body: <p>I'm using python2.6. Is it available in higher version of python?<br>
  Else is there any other way I can maintain priority queues for list of objects of non-trivial classes?
  What I need is something like this</p>
  
  <pre><code>&gt;&gt;&gt; l = [ ['a', 3], ['b', 1] ]
  &gt;&gt;&gt; def foo(x, y):
  ...   return x[1]-y[1]
  &gt;&gt;&gt; heap = heapify(l, cmp=foo)
  </code></pre>
  
  <p>Any suggestions ?</p>