The first value is the priority. The lowest priority comes out of the queue first, so you first example makes sense. The second example is correct also, because in alphabetical order "one" < "three" < "two"
. It's treating your strings as the priorities and sorting by them. As it says at the page you linked:
"The lowest valued entries are retrieved first (the lowest valued entry is the one returned by sorted(list(entries))[0])."
Also you may want to be putting tuples into the queue, I'm not sure, e.g.
pq.put((1, "some data"))
pq.put((2, "some lower priority data"))