[attributs] Compare methode entre les attributs
This commit is contained in:
parent
aea8e9d974
commit
8739640687
1 changed files with 6 additions and 0 deletions
|
@ -227,6 +227,12 @@ class Attr(object):
|
|||
else:
|
||||
return False
|
||||
|
||||
def __cmp__(self, obj):
|
||||
if isinstance(obj, Attr):
|
||||
return self.value.__cmp__(obj.value)
|
||||
else:
|
||||
return self.value.__cmp__(obj)
|
||||
|
||||
def __nonzero__(self):
|
||||
return self.value.__nonzero__()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue