On 09.01.2016 19:32, Paul Rubin wrote:
"Sven R. Kunze" <srku...@mail.de> writes:
Basically a task scheduler where tasks can be thrown away once they
are too long in the queue.
I don't think there's a real nice way to do this with heapq. The
computer-sciencey way would involve separate balanced tree structures
for the two sorting keys (think of a database table with indexes on two
different columns).
Others suggested using an additional dict where to store the indexes of
the items. Then, when removing an item, I just need to query the dict.
Best,
Sven
--
https://mail.python.org/mailman/listinfo/python-list