From: Raymond Hettinger Date: Fri, 27 Feb 2009 07:47:32 +0000 (+0000) Subject: Give mapping views a usable repr. X-Git-Tag: v3.1a1~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89fc2b78214b97f7bc5d3fcf32d9e4cb9940c1dd;p=thirdparty%2FPython%2Fcpython.git Give mapping views a usable repr. --- diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index c7636ec80e6f..45747a6c49ba 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py @@ -392,6 +392,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):