You can use Queue.PriorityQueue.
Recall that Python isn’t strongly typed, so you can save anything you like: just make a tuple of (priority, thing) and you’re set.
You can use Queue.PriorityQueue.
Recall that Python isn’t strongly typed, so you can save anything you like: just make a tuple of (priority, thing) and you’re set.