mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
use __qualname__ to compute bound method repr (closes #21389)
Patch from Steven Barker.
This commit is contained in:
parent
2b7ccbda90
commit
48ad7c0b01
4 changed files with 75 additions and 33 deletions
|
@ -157,8 +157,9 @@ class TestDefaultDict(unittest.TestCase):
|
|||
def _factory(self):
|
||||
return []
|
||||
d = sub()
|
||||
self.assertTrue(repr(d).startswith(
|
||||
"defaultdict(<bound method sub._factory of defaultdict(..."))
|
||||
self.assertRegex(repr(d),
|
||||
r"defaultdict\(<bound method .*sub\._factory "
|
||||
r"of defaultdict\(\.\.\., \{\}\)>, \{\}\)")
|
||||
|
||||
# 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