mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #22031: Reprs now always use hexadecimal format with the "0x" prefix
when contain an id in form " at 0x...".
This commit is contained in:
parent
fbc877b794
commit
0c937b3ed6
8 changed files with 19 additions and 8 deletions
|
@ -144,7 +144,7 @@ class WeakValueDictionary(collections.MutableMapping):
|
|||
return o is not None
|
||||
|
||||
def __repr__(self):
|
||||
return "<WeakValueDictionary at %s>" % id(self)
|
||||
return "<WeakValueDictionary at %#x>" % 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 %s>" % id(self)
|
||||
return "<WeakKeyDictionary at %#x>" % 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