Skip to content

Commit 0c5e0f8

Browse files
nstarmanCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
1 parent 10f461c commit 0c5e0f8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/xmmutablemap/_core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ def __eq__(self, other: object) -> bool:
9999
return self._data == dict(other.items())
100100
return NotImplemented
101101

102+
def __hash__(self) -> int:
103+
"""Return an order-insensitive hash based on the mapping contents."""
104+
return hash(frozenset(self._data.items()))
105+
102106
# ===========================================
103107
# Mapping Protocol
104108

0 commit comments

Comments
 (0)