<br>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?<br>

<div class="gmail_quote">2009/3/29 Apollo <span dir="ltr"><<a href="mailto:tjuhzj@qq.com" target="_blank">tjuhzj@qq.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div> </div>
<div>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.</div>
<div> </div>
<div>my question is how to use 'heapq' to extract the biggest item from the heap?  is it possible?</div>
<div> </div>
<div>thanks  in advance.:)</div><br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br>