Skip to content

Commit

Permalink
pdict: When building dataclass hash, include type
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jun 26, 2022
1 parent a55167c commit 29d340e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pytools/persistent_dict.py
Expand Up @@ -341,6 +341,8 @@ def update_for_specific_dtype(key_hash, key):
key_hash.update(key.str.encode("utf8"))

def update_for_dataclass(self, key_hash, key):
self.rec(key_hash, type(key_hash).__name__.encode("utf-8"))

for fld in fields(key):
self.rec(key_hash, fld.name)
self.rec(key_hash, getattr(key, fld.name, None))
Expand Down

0 comments on commit 29d340e

Please sign in to comment.