Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def pop_task():
- 'Remove and return the lowest priority task. Raise KeyError if empty.'
- while pq:
- priority, count, task = heappop(pq)
- if task is not REMOVED:
- del entry_finder[task]
- return task
- raise KeyError('pop from an empty priority queue')
Add Comment
Please, Sign In to add comment