weaksortedlist

class blist.weaksortedlist(iterable=(), key=None)

A weaksortedlist provides exactly the same methods and has the same performance characteristics as a sortedlist. However, it keeps a weak reference to its members instead of a strong reference. After an item has no more strong references to it, the item will be removed from the list.