I suppose you could wrap your value type in a class and reimplement the builtin __cmp__ method to make it behave reversely or if it's a builtin numeric value type you could even push the negative into the heap in the first place? 2009/3/29 Apollo <tju...@qq.com>
> > as we all known, in the standard module 'heapq', we can easily get the > smallest item from the heap. i.e. it's an implementation of min-heap. > > my question is how to use 'heapq' to extract the biggest item from the > heap? is it possible? > > thanks in advance.:) > > -- > http://mail.python.org/mailman/listinfo/python-list > >
-- http://mail.python.org/mailman/listinfo/python-list