title: How to put items into priority queues?
body: <p>In the Python docs,</p>
  
  <blockquote>
    <p>The lowest valued entries are retrieved first (the lowest valued entry is the one returned by <code>sorted(list(entries))[0]</code>). A typical pattern for entries is a tuple in the form: <code>(priority_number, data)</code>.</p>
  </blockquote>
  
  <p>It appears the queue will be sorted by priority then data, which may not be always correct. Suppose data "item 2", is enqueued before "item 1", item 1 will still go first. In another docs page, <a href="http://docs.python.org/dev/py3k/library/heapq.html?highlight=heapq#priority-queue-implementation-notes" rel="noreferrer">heapq</a>, it suggests the use of a counter. So I will store my data like <code>entry = [priority, count, task]</code>. Isn't there something like</p>
  
  <pre><code>PriorityQueue.put(item, priority)
  </code></pre>
  
  <p>Then I won't need to implement the ordering myself?</p>