summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-02-08 23:34:21 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-02-08 23:34:21 (GMT)
commitd53f1c4d41e863c8a7f0653ea7af04dc0b4faa84 (patch)
tree86978a25e2d205e88464be3277bfca322ff44b92 /Lib
parent18a1ffcda373fad5f60c187217d7c2125bccf005 (diff)
downloadcpython-d53f1c4d41e863c8a7f0653ea7af04dc0b4faa84.zip
cpython-d53f1c4d41e863c8a7f0653ea7af04dc0b4faa84.tar.gz
cpython-d53f1c4d41e863c8a7f0653ea7af04dc0b4faa84.tar.bz2
Fill-in missing Set comparisons
Diffstat (limited to 'Lib')
-rw-r--r--Lib/_abcoll.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py
index 30ec7d4..4009ccb 100644
--- a/Lib/_abcoll.py
+++ b/Lib/_abcoll.py
@@ -163,11 +163,24 @@ class Set:
return NotImplemented
return len(self) < len(other) and self.__le__(other)
+ def __gt__(self, other):
+ if not isinstance(other, Set):
+ return NotImplemented
+ return other < self
+
+ def __ge__(self, other):
+ if not isinstance(other, Set):
+ return NotImplemented
+ return other <= self
+
def __eq__(self, other):
if not isinstance(other, Set):
return NotImplemented
return len(self) == len(other) and self.__le__(other)
+ def __ne__(self, other):
+ return not (self == other)
+
@classmethod
def _from_iterable(cls, it):
'''Construct an instance of the class from any iterable input.