On May 25, 8:02 pm, Rodrigo Lazo <rlazo.... at gmail.com> wrote: > what about heapq for sorting? Heap is the data structure to use for 'fast (nearly) sorted inserts'. But heapq do not support (as far as I know) deletion of duplicates. But a custom heap class coud do that of course.