summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-02-27 08:09:47 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-02-27 08:09:47 (GMT)
commitb31a6d0949faecc933754f32ac956bc4aad76fff (patch)
tree05f04f636bea45b71252efe5da8a907a68ffefcb
parentac10be365e5c25f2bedac75b3269a22f361d51e5 (diff)
downloadcpython-b31a6d0949faecc933754f32ac956bc4aad76fff.zip
cpython-b31a6d0949faecc933754f32ac956bc4aad76fff.tar.gz
cpython-b31a6d0949faecc933754f32ac956bc4aad76fff.tar.bz2
Give mapping views a usable repr.
-rw-r--r--Lib/_abcoll.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py
index 942a72c..40cc23e 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):