Skip to content

Commit 520d828

Browse files
committed
hashable brainpy.tools.DotDict
1 parent c043281 commit 520d828

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

brainpy/_src/tools/dicts.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ def unique(self):
217217
gather[k] = v
218218
return gather
219219

220+
def __hash__(self):
221+
return hash(tuple(sorted(self.items())))
222+
220223

221224
register_pytree_node(
222225
DotDict,

0 commit comments

Comments
 (0)