mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
set tp_new from the class in the hierarchy that actually owns the descriptor (closes #25731)
Debugging by Eryk Sun.
This commit is contained in:
parent
9e9f850f99
commit
9ad11544bf
3 changed files with 11 additions and 1 deletions
|
@ -4564,6 +4564,14 @@ order (MRO) for bases """
|
|||
self.assertRegex(repr(method),
|
||||
r"<bound method qualname of <object object at .*>>")
|
||||
|
||||
def test_deleting_new_in_subclasses(self):
|
||||
class X:
|
||||
def __init__(self, a):
|
||||
pass
|
||||
X.__new__ = None
|
||||
del X.__new__
|
||||
X(1) # should work
|
||||
|
||||
|
||||
class DictProxyTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue