From 480497ce4e597116443fe53b236b266b6445cacb Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sat, 15 Mar 2014 22:49:39 +0100 Subject: [PATCH] =?UTF-8?q?[attributs]=20Fonction=20utile=20sur=20les=20At?= =?UTF-8?q?trsList,=20=5F=5Fcmp=5F=5F=20ne=20sert=20=C3=A0=20rien=20et=20p?= =?UTF-8?q?lante=20si=20python=5Ftype=20=3D=20int?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- attributs.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/attributs.py b/attributs.py index c6aa2b9..de90aa7 100644 --- a/attributs.py +++ b/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