summaryrefslogtreecommitdiff
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-01-18 21:11:18 -0800
committerBenjamin Peterson <benjamin@python.org>2016-01-18 21:11:18 -0800
commit9ad11544bfb80b7881e0d567e40ef2fa2da58f02 (patch)
tree3541a0acf72d617ab42811ced0b4dac474b65d73 /Lib/test/test_descr.py
parent9e9f850f9912228a8963f94f4b0480215a6c168c (diff)
downloadcpython-git-9ad11544bfb80b7881e0d567e40ef2fa2da58f02.tar.gz
set tp_new from the class in the hierarchy that actually owns the descriptor (closes #25731)
Debugging by Eryk Sun.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index f5e4b02b7b..a8206d3146 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -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):