Antoine Pitrou <pit...@free.fr> added the comment: Mainly to protect against potential infinite recursion with isinstance checks. Also, performance is probably better.
Here are the relevant code and comments in PyErr_GivenExceptionMatches() (in Python/errors.c): /* PyObject_IsSubclass() can recurse and therefore is not safe (see test_bad_getattr in test.pickletester). */ res = PyType_IsSubtype((PyTypeObject *)err, (PyTypeObject *)exc); ---------- nosy: +pitrou versions: -Python 2.5, Python 2.6, Python 2.7, Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10011> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com