Browse Source

drop unnecessary rich comparission operators... order by class name,

then by object id..

[git-p4: depot-paths = "//depot/": change = 1348]
main
John-Mark Gurney 15 years ago
parent
commit
24209f6722
1 changed files with 2 additions and 19 deletions
  1. +2
    -19
      DIDLLite.py

+ 2
- 19
DIDLLite.py View File

@@ -106,27 +106,10 @@ class Object(object):
if kwargs.has_key('content'):
self._content = kwargs['content']

def __lt__(self, other):
return self.__cmp__(other) < 0

def __le__(self, other):
return self.__cmp__(other) <= 0

def __eq__(self, other):
return self.__cmp__(other) == 0

def __ne__(self, other):
return self.__cmp__(other) != 0

def __gt__(self, other):
return self.__cmp__(other) > 0

def __ge__(self, other):
return self.__cmp__(other) >= 0

def __cmp__(self, other):
if not isinstance(other, self.__class__):
return 1
return cmp(self.__class__.__name__,
other.__class__.__name__)
return cmp(self.id, other.id)

def __repr__(self):


Loading…
Cancel
Save