[Python-checkins] cpython (3.5): backout 3c9512d8ac0d

benjamin.peterson python-checkins at python.org
Sat May 28 17:08:16 EDT 2016


https://hg.python.org/cpython/rev/e9ae5d18d0fa
changeset:   101547:e9ae5d18d0fa
branch:      3.5
parent:      101540:6f50c04e4a1e
user:        Benjamin Peterson <benjamin at python.org>
date:        Sat May 28 14:04:40 2016 -0700
summary:
  backout 3c9512d8ac0d

files:
  Lib/test/test_descr.py |  8 --------
  Misc/NEWS              |  2 --
  Objects/typeobject.c   |  2 +-
  3 files changed, 1 insertions(+), 11 deletions(-)


diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -4564,14 +4564,6 @@
         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):
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -80,8 +80,6 @@
   (``int``) and ``f2()`` returns ``1.0`` (``int``), even if ``1`` and ``1.0``
   are equal.
 
-- Issue #25731: Fix set and deleting __new__ on a class.
-
 - Issue #22995: [UPDATE] Comment out the one of the pickleability tests in
   _PyObject_GetState() due to regressions observed in Cython-based projects.
 
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6777,7 +6777,7 @@
                sanity checks and constructing a new argument
                list.  Cut all that nonsense short -- this speeds
                up instance creation tremendously. */
-            specific = (void *)((PyTypeObject *)PyCFunction_GET_SELF(descr))->tp_new;
+            specific = (void *)type->tp_new;
             /* XXX I'm not 100% sure that there isn't a hole
                in this reasoning that requires additional
                sanity checks.  I'll buy the first person to

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list