diff options
author | Raymond Hettinger <python@rcn.com> | 2009-02-27 07:47:32 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-02-27 07:47:32 (GMT) |
commit | 89fc2b78214b97f7bc5d3fcf32d9e4cb9940c1dd (patch) | |
tree | 0baab0e29b280d4762f8a8abcf7a760a92339718 | |
parent | 3177f2fdb0f0562a097a506952ad13c8773f719a (diff) | |
download | cpython-89fc2b78214b97f7bc5d3fcf32d9e4cb9940c1dd.zip cpython-89fc2b78214b97f7bc5d3fcf32d9e4cb9940c1dd.tar.gz cpython-89fc2b78214b97f7bc5d3fcf32d9e4cb9940c1dd.tar.bz2 |
Give mapping views a usable repr.
-rw-r--r-- | Lib/_abcoll.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index c7636ec..45747a6 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): |