Merge issue #16373: Prevent infinite recursion for ABC Set class operations.

Patch by Serhiy Storchaka.
This commit is contained in:
Andrew Svetlov 2012-11-01 13:31:12 +02:00
commit b904e4256e
2 changed files with 35 additions and 2 deletions

View file

@ -200,12 +200,12 @@ class Set(Sized, Iterable, Container):
def __gt__(self, other):
if not isinstance(other, Set):
return NotImplemented
return other < self
return other.__lt__(self)
def __ge__(self, other):
if not isinstance(other, Set):
return NotImplemented
return other <= self
return other.__le__(self)
def __eq__(self, other):
if not isinstance(other, Set):