[EMAIL PROTECTED] kirjoitti:
> I think the sort has to be simplified, otherwise it can't keep the heap
> invariant...
>
> def sort(self):
> self.h.sort()
>
> Bye,
> bearophile
>
And __repr__ should be something like this:
=========
def __repr__(self):
if self.h:
return "Heap(%s)" % self.h
else:
return "Heap()"
==========
to make it compatible with versions earlier than 2.5Cheers, Jussi -- http://mail.python.org/mailman/listinfo/python-list
