This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author thansen
Recipients Ringding, Trundle, aronacher, benjamin.peterson, gvanrossum, pitrou, prologic, python-dev, sebastinas, serhiy.storchaka, thansen, vstinner
Date 2016-12-10.13:51:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This change breaks backward compatibility in Python 2.7. This is the example that also broke in #25731. In that case the change was reverted. See

$ cat foo.pxd 
cdef class B:
    cdef object b
$ cat foo.pyx 
cdef class A:

cdef class B:
    def __init__(self, b):
        self.b = b
$ cat
from foo import A, B

class C(A, B):
    def __init__(self):
        B.__init__(self, 1)

$ cython foo.pyx && gcc -I/usr/include/python2.7 -Wall -shared -fPIC -o foo.c
$ python -c 'import bar'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "", line 7, in <module>
TypeError: foo.A.__new__(C) is not safe, use foo.B.__new__()
Date User Action Args
2016-12-10 13:51:18thansensetrecipients: + thansen, gvanrossum, pitrou, vstinner, sebastinas, benjamin.peterson, aronacher, prologic, Trundle, Ringding, python-dev, serhiy.storchaka
2016-12-10 13:51:17thansensetmessageid: <>
2016-12-10 13:51:17thansenlinkissue5322 messages
2016-12-10 13:51:17thansencreate