mirror of https://github.com/python/cpython
Give mapping views a usable repr.
This commit is contained in:
parent
ac10be365e
commit
b31a6d0949
|
@ -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):
|
||||
|
||||
|
|
Loading…
Reference in New Issue