need to return -1 from __cmp__ to return "less than"

This commit is contained in:
David Vierra 2011-11-01 00:04:35 -10:00
parent 464ecd818b
commit b39cb3e7e6

View File

@ -31,7 +31,7 @@ class Block(object):
return str(self)
def __cmp__(self, other):
if not isinstance(other, Block): return False
if not isinstance(other, Block): return -1
key = lambda a:a and (a.ID, a.blockData)
return cmp( key(self), key(other))