[attributs] Fonction utile sur les AttrsList, __cmp__ ne sert à rien et plante si python_type = int
This commit is contained in:
parent
4fea59bbeb
commit
480497ce4e
1 changed files with 5 additions and 6 deletions
11
attributs.py
11
attributs.py
|
@ -152,6 +152,11 @@ class AttrsList(list):
|
|||
super(AttrsList, self).__delitem__(index)
|
||||
self._commit()
|
||||
|
||||
def __setitem__(self, index, value):
|
||||
self._start()
|
||||
super(AttrsList, self).__setitem__(index, value)
|
||||
self._commit()
|
||||
|
||||
def append(self, val):
|
||||
self._start()
|
||||
super(AttrsList, self).append(val)
|
||||
|
@ -302,12 +307,6 @@ 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):
|
||||
if self.value:
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue