[Python-checkins] r70016 - python/trunk/Lib/_abcoll.py

raymond.hettinger python-checkins at python.org
Fri Feb 27 09:09:47 CET 2009


Author: raymond.hettinger
Date: Fri Feb 27 09:09:47 2009
New Revision: 70016

Log:
Give mapping views a usable repr.

Modified:
   python/trunk/Lib/_abcoll.py

Modified: python/trunk/Lib/_abcoll.py
==============================================================================
--- python/trunk/Lib/_abcoll.py	(original)
+++ python/trunk/Lib/_abcoll.py	Fri Feb 27 09:09:47 2009
@@ -371,6 +371,9 @@
     def __len__(self):
         return len(self._mapping)
 
+    def __repr__(self):
+        return '{0.__class__.__name__}({0._mapping!r})'.format(self)
+
 
 class KeysView(MappingView, Set):
 


More information about the Python-checkins mailing list