how to use "heapq" module as a max-heap?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sun Mar 29 07:05:15 EDT 2009


Apollo:
>  my question is how to use 'heapq' to extract the biggest item from the heap?  is it possible?

This wrapper allows you to give a key function:
http://code.activestate.com/recipes/502295/

Bye,
bearophile



More information about the Python-list mailing list