]> granicus.if.org Git - python/commitdiff
Give mapping views a usable repr.
authorRaymond Hettinger <python@rcn.com>
Fri, 27 Feb 2009 08:09:47 +0000 (08:09 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 27 Feb 2009 08:09:47 +0000 (08:09 +0000)
Lib/_abcoll.py

index 942a72c0ce76cf25342cd96f88044a58c16687c8..40cc23e0489ef6eda09a1c2e18064919aa840284 100644 (file)
@@ -371,6 +371,9 @@ class MappingView(Sized):
     def __len__(self):
         return len(self._mapping)
 
+    def __repr__(self):
+        return '{0.__class__.__name__}({0._mapping!r})'.format(self)
+
 
 class KeysView(MappingView, Set):