Unlike Store which provides first-in first-out discipline, PriorityStore maintains items in sorted order such that the smallest items value are retrieved first from the store.
All items in a PriorityStore instance must be order-able; which is to say that items must implement __lt__().
I've implemented __lt__ such that higher numbers should come first.
However, when I start putting items into an instance of PriorityStore, after a few inserts they don't appear sorted:
And when I trace the calls to __lt__ it is only called once on any given put(item) call. Shouldn't __lt__ be called multiple times to find the right place for any given item?
Or else, am I missing something in my understanding?
Kind regards,
Constantine