mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
Issue #22033: Reprs of most Python implemened classes now contain actual
class name instead of hardcoded one.
This commit is contained in:
parent
54701f303f
commit
465e60e654
24 changed files with 102 additions and 74 deletions
|
@ -144,7 +144,7 @@ class WeakValueDictionary(collections.MutableMapping):
|
|||
return o is not None
|
||||
|
||||
def __repr__(self):
|
||||
return "<WeakValueDictionary at %#x>" % id(self)
|
||||
return "<%s at %#x>" % (self.__class__.__name__, id(self))
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
if self._pending_removals:
|
||||
|
@ -348,7 +348,7 @@ class WeakKeyDictionary(collections.MutableMapping):
|
|||
return len(self.data) - len(self._pending_removals)
|
||||
|
||||
def __repr__(self):
|
||||
return "<WeakKeyDictionary at %#x>" % id(self)
|
||||
return "<%s at %#x>" % (self.__class__.__name__, id(self))
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
self.data[ref(key, self._remove)] = value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue