Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __eq__(self, other):
if not isinstance(other, MapMutation):
return NotImplemented
if len(self) != len(other):
return False
for key, val in self.__root.items():
try:
oval = other.__root.find(0, map_hash(key), key)
except KeyError:
return False
else:
if oval != val:
return False
return True
def mutate(self):
return MapMutation(self.__count, self.__root)