need to return -1 from __cmp__ to return "less than"
This commit is contained in:
parent
464ecd818b
commit
b39cb3e7e6
@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user