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:
Serhiy Storchaka 2017-09-21 14:24:13 +03:00 committed by GitHub
parent 9adda0cdf8
commit b3a77964ea
6 changed files with 40 additions and 20 deletions

View file

@ -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.