Commit 2c028492 authored by Benjamin Peterson's avatar Benjamin Peterson

merge 3.5 (#25731)

parents 3114d763 9ad11544
...@@ -4564,6 +4564,14 @@ order (MRO) for bases """ ...@@ -4564,6 +4564,14 @@ order (MRO) for bases """
self.assertRegex(repr(method), self.assertRegex(repr(method),
r"<bound method qualname of <object object at .*>>") 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): class DictProxyTests(unittest.TestCase):
def setUp(self): def setUp(self):
......
...@@ -13,6 +13,8 @@ Core and Builtins ...@@ -13,6 +13,8 @@ Core and Builtins
- Issue #25791: Trying to resolve a relative import without __spec__ or - Issue #25791: Trying to resolve a relative import without __spec__ or
__package__ defined now raises an ImportWarning __package__ defined now raises an ImportWarning
- Issue #25731: Fix set and deleting __new__ on a class.
- Issue #25961: Disallowed null characters in the type name. - Issue #25961: Disallowed null characters in the type name.
- Issue #25973: Fix segfault when an invalid nonlocal statement binds a name - Issue #25973: Fix segfault when an invalid nonlocal statement binds a name
......
...@@ -6791,7 +6791,7 @@ update_one_slot(PyTypeObject *type, slotdef *p) ...@@ -6791,7 +6791,7 @@ update_one_slot(PyTypeObject *type, slotdef *p)
sanity checks and constructing a new argument sanity checks and constructing a new argument
list. Cut all that nonsense short -- this speeds list. Cut all that nonsense short -- this speeds
up instance creation tremendously. */ up instance creation tremendously. */
specific = (void *)type->tp_new; specific = (void *)((PyTypeObject *)PyCFunction_GET_SELF(descr))->tp_new;
/* XXX I'm not 100% sure that there isn't a hole /* XXX I'm not 100% sure that there isn't a hole
in this reasoning that requires additional in this reasoning that requires additional
sanity checks. I'll buy the first person to sanity checks. I'll buy the first person to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment