mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Merge issue #16373: Prevent infinite recursion for ABC Set class operations.
Patch by Serhiy Storchaka.
This commit is contained in:
commit
b904e4256e
2 changed files with 35 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue