From: Raymond Hettinger Date: Fri, 8 Feb 2008 23:34:21 +0000 (+0000) Subject: Fill-in missing Set comparisons X-Git-Tag: v2.6a1~226 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d53f1c4d41e863c8a7f0653ea7af04dc0b4faa84;p=python Fill-in missing Set comparisons --- diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index 30ec7d4280..4009ccb591 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.