Kent Johnson wrote:
heapq.nlargest() heapq.nsmallest()
On second thought, that doesn't actually get me very far. I do not know in advance how many I must select since I need to remove duplicates *after* sorting (they are not necessarily 'duplicate' enough to fall into the same sort bucket). What I'd like to do is heapify and then create an iterator for the result. But since heapify doesn't support "reverse" ...
Any other ideas?
Stefan -- http://mail.python.org/mailman/listinfo/python-list