Fix errors
This commit is contained in:
parent
1aa85cc295
commit
ed5baefd5d
2 changed files with 15 additions and 1 deletions
|
|
@ -236,6 +236,20 @@ class ItemSet:
|
|||
|
||||
def __init__(self, items=None):
|
||||
self.items = items or {}
|
||||
self._hash = None
|
||||
|
||||
def __hash__(self):
|
||||
# TODO: FREEZE
|
||||
if self._hash is None:
|
||||
self._hash = hash(tuple((key, frozenset(value)) for key, value in self.items.items()))
|
||||
|
||||
return self._hash
|
||||
|
||||
def __eq__(self, other):
|
||||
if not isinstance(other, ItemSet):
|
||||
return False
|
||||
|
||||
return self.items == other.items
|
||||
|
||||
def weakly_compatible(self, other: "ItemSet") -> bool:
|
||||
a = self.items
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue