Skip to content

Commit

Permalink
intset: Allow equality comp with sets
Browse files Browse the repository at this point in the history
  • Loading branch information
BjarniRunar committed Sep 29, 2022
1 parent e61de80 commit b88a051
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions moggie/util/intset.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def __ne__(self, other):
return True
except StopIteration:
return False
elif isinstance(other, set):
return self.__ne__(sorted(list(other)))
elif isinstance(other, IntSet):
if (self.npa is None) and (other.npa is None):
return False
Expand Down Expand Up @@ -372,6 +374,7 @@ def count(self):
assert(b1 != some)
assert(b2 != many)
assert(b3 == few)
assert(b3 == set(few))
assert(b3 == IntSet(few))
assert(b3 != 'hello')
assert(b3 != None)
Expand Down

0 comments on commit b88a051

Please sign in to comment.