Skip to content
Snippets Groups Projects
Commit f9fc1062 authored by vlorentz's avatar vlorentz
Browse files

add ImmutableDict.__repr__

It can help in pytest's diffs
parent b58d901b
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,9 @@ class ImmutableDict(Mapping, Generic[KT, VT]):
else:
self.data = tuple(data)
def __repr__(self):
return f"ImmutableDict({dict(self.data)!r})"
def __getitem__(self, key):
for (k, v) in self.data:
if k == key:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment