I need to implement an event list in python, where each element is an event that has an associated timestamp. The actions that I need to perform are essentially two: inserting in the right order (decreasing timestamps), and retrieving the event with the smaller start time.
I am aware of the bisect module, however, it doesn't permit to insert of arbitrary items in the list. Hence I feel that perhaps I could execute the occasion list with two unique python
a bisect list containing all the timestamps
a dictionary with the timestamps as the keys and the events as value
Inserting and retrieving is straightforward.
Do you feel that there is a more effective approach?