A note on heapq module

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Jan 18 17:27:15 EST 2007


Steven Bethard wrote:
> The current code fails when using unbound methods however::

I don't like your solution, this class was already slow enough. Don't
use unbound methods with this class :-)
Maybe there's a (better) solution to your problem: to make Heap a
function (or classmethod) that return sone of two possibile objects
created by one of two different classes that have different methods...

Beside that, I think __eq__ method needs more tests, because comparing
a Heap with key against another Heap without key may give some
problems...

I'll think about such problems/things.

Bye,
bearophile




More information about the Python-list mailing list