A note on heapq module

Scott David Daniels scott.daniels at acm.org
Tue Jan 16 13:39:38 EST 2007


Scott David Daniels wrote:

Sorry, I blew the __ne__:

>>     def __ne__(self, other):
>>         return not isinstance(other, Heap) or self.h != other.h
>           return not isinstance(other, self.__class__) and sorted(
>                                      self.h) != sorted(other.h)
Should be:
           return not isinstance(other, self.__class__) or sorted(
                                         self.h) != sorted(other.h)

--Scott David Daniels
scott.daniels at acm.org



More information about the Python-list mailing list