From ff9966ac0df04e4b824f974834d5b9343011bd49 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. git-svn-id: http://svn.python.org/projects/python/trunk@70016 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Lib/_abcoll.py | 3 +++ 1 file changed, 3 insertions(+) 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): -- 2.11.4.GIT