Author benjamin.peterson
Recipients Stanisław Skonieczny (Uosiu), benjamin.peterson, bkabrda, eryksun, jcristau, python-dev, twouters
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, StanisÅ‚aw Skonieczny (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