title: Priority function for Priority Queue in Python
body: <p>How would I write the following Java PriorityQueue in Python?</p>
  
  <pre><code>PriorityQueue&lt;Integer[]&gt; pq = new PriorityQueue&lt;Integer[]&gt;(11,
          new Comparator&lt;Integer[]&gt;() {
            public int compare(Integer[] A, Integer[] B) {
              return A[0] &lt; B[0] ? -1 : 1;
            }
          });
  </code></pre>
  
  <p>I got as far as </p>
  
  <pre><code>from Queue import PriorityQueue
  def my_method(self):
    pq = # I got stuck here since I need to include "comparator"
  </code></pre>
  
  <p>I have looked through many examples such as <a href="https://stackoverflow.com/questions/3311480/creating-a-python-priority-queue">Creating a python priority Queue</a> but they don't seem to be defining a <code>priorty function</code> or <code>comparator</code> of some sort.</p>