mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
Give mapping views a usable repr.
This commit is contained in:
parent
3177f2fdb0
commit
89fc2b7821
1 changed files with 3 additions and 0 deletions
|
|
@ -392,6 +392,9 @@ def __init__(self, mapping):
|
|||
def __len__(self):
|
||||
return len(self._mapping)
|
||||
|
||||
def __repr__(self):
|
||||
return '{0.__class__.__name__}({0._mapping!r})'.format(self)
|
||||
|
||||
|
||||
class KeysView(MappingView, Set):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue