Chris Rebert <pyb...@rebertia.com> added the comment:

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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to