From: Raymond Hettinger Date: Fri, 27 Feb 2009 08:09:47 +0000 (+0000) Subject: Give mapping views a usable repr. X-Git-Tag: v2.7a1~1934 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b31a6d0949faecc933754f32ac956bc4aad76fff;p=python Give mapping views a usable repr. --- diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index 942a72c0ce..40cc23e048 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py @@ -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):