From b31a6d0949faecc933754f32ac956bc4aad76fff Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 27 Feb 2009 08:09:47 +0000 Subject: [PATCH] Give mapping views a usable repr. --- Lib/_abcoll.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index 942a72c0ce7..40cc23e0489 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py @@ -371,6 +371,9 @@ def __init__(self, mapping): def __len__(self): return len(self._mapping) + def __repr__(self): + return '{0.__class__.__name__}({0._mapping!r})'.format(self) + class KeysView(MappingView, Set):