Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89fc2b7

Browse files
committed
Give mapping views a usable repr.
1 parent 3177f2f commit 89fc2b7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/_abcoll.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ def __init__(self, mapping):
392392
def __len__(self):
393393
return len(self._mapping)
394394

395+
def __repr__(self):
396+
return '{0.__class__.__name__}({0._mapping!r})'.format(self)
397+
395398

396399
class KeysView(MappingView, Set):
397400

0 commit comments

Comments
 (0)