mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-27541: Reprs of subclasses of some classes now contain actual type name. (#3631)
Affected classes are bytearray, array, deque, defaultdict, count and repeat.
This commit is contained in:
parent
9adda0cdf8
commit
b3a77964ea
6 changed files with 40 additions and 20 deletions
|
@ -157,8 +157,8 @@ class TestDefaultDict(unittest.TestCase):
|
|||
return []
|
||||
d = sub()
|
||||
self.assertRegex(repr(d),
|
||||
r"defaultdict\(<bound method .*sub\._factory "
|
||||
r"of defaultdict\(\.\.\., \{\}\)>, \{\}\)")
|
||||
r"sub\(<bound method .*sub\._factory "
|
||||
r"of sub\(\.\.\., \{\}\)>, \{\}\)")
|
||||
|
||||
# NOTE: printing a subclass of a builtin type does not call its
|
||||
# tp_print slot. So this part is essentially the same test as above.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue