Use dict.__repr__ for IdnaDict

This commit is contained in:
Ross McFarland
2022-08-18 07:42:08 -07:00
parent f00474cca4
commit 286e2bc94d
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -69,3 +69,6 @@ class IdnaDict(MutableMapping):
def decoded_items(self):
for key, value in self.items():
yield (idna_decode(key), value)
def __repr__(self):
return self._data.__repr__()
+3
View File
@@ -108,6 +108,9 @@ class TestIdnaDict(TestCase):
self.assertFalse(self.utf8 in d)
self.assertFalse(idna_encode(self.utf8) in d)
# smoke test of repr
d.__repr__()
def test_keys(self):
d = IdnaDict(self.normal)