[issue12029] Catching virtual subclasses in except clauses

Antoine Pitrou report at bugs.python.org
Thu Oct 2 13:19:50 CEST 2014


Antoine Pitrou added the comment:

> Since type has __subclasscheck__ (why I don't know)

Ouch, really? That means the PyType_IsSubtype path in PyObject_IsSubclass() is never taken?

I think we should add a tp_subclasscheck slot to minimize the general cost of this. Also, try to see if there aren't redundant type / tuple checks along the way.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12029>
_______________________________________


More information about the Python-bugs-list mailing list