[docs] [issue28437] Class definition is not consistent with types.new_class
Neil Girdhar
report at bugs.python.org
Sat Oct 15 13:52:56 EDT 2016
Neil Girdhar added the comment:
>From your comment:
>>> MyDerivedDynamic = new_class("MyDerivedDynamic", (MyClass,), dict(metaclass=metaclass_callable))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.5/types.py", line 57, in new_class
return meta(name, bases, ns, **kwds)
File "<stdin>", line 2, in metaclass_callable
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
This is in the wrong place. It should be tripping the exception you defined in Lib/types.py. (It will do that if you replace metaclass_callable with OtherMetaclass.)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28437>
_______________________________________
More information about the docs
mailing list