[issue27157] Unhelpful error message when one calls a subclass of type with a custom metaclass

Emanuel Barry report at bugs.python.org
Sun May 29 20:39:08 EDT 2016


Emanuel Barry added the comment:

Yes, that would be preferable. The error message is at Objects/typeobject.c#l2301, but keep in mind that this message is shown for both faulty calls to type() as well as any of its subclasses that don't override __new__, and I'm lukewarm on adding e.g. a PyType_Check call before that; might as well replace the PyType_CheckExact call and make this work. I'm not knowledgeable enough in that field though, you'll need a core dev's advice.

----------
stage: resolved -> 

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


More information about the Python-bugs-list mailing list