Author cvrebert
Recipients acooke, cvrebert, daniel.urban, eric.araujo
Date 2011-05-24.02:10:15
SpamBayes Score 2.58167e-08
Marked as misclassified No
Message-id <1306203015.92.0.184460470427.issue12029@psf.upfronthosting.co.za>
In-reply-to
Content
Scouting around the CPython codebase a bit, I speculate that the cause of this behavior is that PyErr_GivenExceptionMatches() in errors.c uses PyType_IsSubtype() [which simply walks a class's __mro__ checking for pointer equality] rather than PyObject_IsSubclass()/PyObject_IsInstance() [which are smart enough to consult __subclasscheck__()/__instancecheck__() if they exist].

Of course, the more important issue here is whether this behavior is intended or not. I surmise python-dev needs to have a discussion about it?
History
Date User Action Args
2011-05-24 02:10:16cvrebertsetrecipients: + cvrebert, acooke, eric.araujo, daniel.urban
2011-05-24 02:10:15cvrebertsetmessageid: <1306203015.92.0.184460470427.issue12029@psf.upfronthosting.co.za>
2011-05-24 02:10:15cvrebertlinkissue12029 messages
2011-05-24 02:10:15cvrebertcreate