Skip to content
Snippets Groups Projects
Commit 11d9663e authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'Field.hashable_contents' into 'master'

Avoid `hash()` in Field.hashable_contents

See merge request pycodegen/pystencils!91
parents 1ff1469c 7e5faa0a
Branches
Tags
1 merge request!91Avoid `hash()` in Field.hashable_contents
Pipeline #19963 passed with warnings
...@@ -539,8 +539,13 @@ class Field(AbstractField): ...@@ -539,8 +539,13 @@ class Field(AbstractField):
return Field.Access(self, center)(*args, **kwargs) return Field.Access(self, center)(*args, **kwargs)
def hashable_contents(self): def hashable_contents(self):
dth = hash(self._dtype) return (self._layout,
return self._layout, self.shape, self.strides, dth, self.field_type, self._field_name, self.latex_name self.shape,
self.strides,
self.field_type,
self._field_name,
self.latex_name,
self._dtype)
def __hash__(self): def __hash__(self):
return hash(self.hashable_contents()) return hash(self.hashable_contents())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment