[Python-checkins] r70015 - python/branches/py3k/Lib/_abcoll.py

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


Author: raymond.hettinger
Date: Fri Feb 27 08:47:32 2009
New Revision: 70015

Log:
Give mapping views a usable repr.

Modified:
   python/branches/py3k/Lib/_abcoll.py

Modified: python/branches/py3k/Lib/_abcoll.py
==============================================================================
--- python/branches/py3k/Lib/_abcoll.py	(original)
+++ python/branches/py3k/Lib/_abcoll.py	Fri Feb 27 08:47:32 2009
@@ -392,6 +392,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