Skip to content

Commit

Permalink
support hash
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiyuan Chen <[email protected]>
  • Loading branch information
ZhiyuanChen committed Apr 14, 2023
1 parent b15617f commit 16ea94e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chanfig/flat_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,9 @@ def _add_indent(self, text: str) -> str:
text = first + "\n" + text
return text

def __hash__(self):
return hash(frozenset(self.items()))

def __getstate__(self, *args, **kwargs):
return self.__dict__

Expand Down

0 comments on commit 16ea94e

Please sign in to comment.