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 benjamin.peterson
Recipients benjamin.peterson, bkabrda, eryksun, jcristau, python-dev, twouters, uosiu
Date 2016-04-16.19:17:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460834259.17.0.511393680512.issue25731@psf.upfronthosting.co.za>
In-reply-to
Content
I believe the correct behavior is actually

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "bar.py", line 7, in <module>
    C()
TypeError: foo.A.__new__(C) is not safe, use foo.B.__new__()

This is because A comes before B in the mro, and, indeed, constructing C with A.__new__ is unsafe. In fact, reordering A and B in the definition of C fixes everything.
History
Date User Action Args
2016-04-16 19:17:39benjamin.petersonsetrecipients: + benjamin.peterson, twouters, python-dev, bkabrda, eryksun, uosiu, jcristau
2016-04-16 19:17:39benjamin.petersonsetmessageid: <1460834259.17.0.511393680512.issue25731@psf.upfronthosting.co.za>
2016-04-16 19:17:39benjamin.petersonlinkissue25731 messages
2016-04-16 19:17:39benjamin.petersoncreate