summaryrefslogtreecommitdiffstats
path: root/Lib/xml/etree/ElementTree.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml/etree/ElementTree.py')
-rw-r--r--Lib/xml/etree/ElementTree.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 782af81..cfac4f7 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -498,10 +498,30 @@ class QName:
return self.text
def __hash__(self):
return hash(self.text)
- def __cmp__(self, other):
+ def __le__(self, other):
if isinstance(other, QName):
- return cmp(self.text, other.text)
- return cmp(self.text, other)
+ return self.text <= other.text
+ return self.text <= other
+ def __lt__(self, other):
+ if isinstance(other, QName):
+ return self.text < other.text
+ return self.text < other
+ def __ge__(self, other):
+ if isinstance(other, QName):
+ return self.text >= other.text
+ return self.text >= other
+ def __gt__(self, other):
+ if isinstance(other, QName):
+ return self.text > other.text
+ return self.text > other
+ def __eq__(self, other):
+ if isinstance(other, QName):
+ return self.text == other.text
+ return self.text == other
+ def __ne__(self, other):
+ if isinstance(other, QName):
+ return self.text != other.text
+ return self.text != other
##
# ElementTree wrapper class. This class represents an entire element