Skip to content

Commit

Permalink
Fix bug with Set equality/inequality
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpalmieri committed Feb 25, 2023
1 parent 8f5bbd2 commit 421bb59
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/sage/sets/set.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,10 +1061,20 @@ def __richcmp__(self, other, op):
False
sage: Set([1]) == set([1])
True
Test set equality and inequality::
sage: L = {0}
sage: S = Set(L)
sage: S == L
True
sage: S != L
False
"""
if not isinstance(other, Set_object_enumerated):
if isinstance(other, (set, frozenset)):
return self.set() == other
if self.set() == other:
return rich_to_bool(op, 0)
return NotImplemented
if self.set() == other.set():
return rich_to_bool(op, 0)
Expand Down

0 comments on commit 421bb59

Please sign in to comment.