[Python-checkins] r60675 - python/trunk/Lib/_abcoll.py
raymond.hettinger
python-checkins at python.org
Sat Feb 9 00:34:21 CET 2008
Author: raymond.hettinger
Date: Sat Feb 9 00:34:21 2008
New Revision: 60675
Modified:
python/trunk/Lib/_abcoll.py
Log:
Fill-in missing Set comparisons
Modified: python/trunk/Lib/_abcoll.py
==============================================================================
--- python/trunk/Lib/_abcoll.py (original)
+++ python/trunk/Lib/_abcoll.py Sat Feb 9 00:34:21 2008
@@ -163,11 +163,24 @@
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.
More information about the Python-checkins
mailing list