[issue21919] Changing cls.__bases__ must ensure proper metaclass inheritance

Karthikeyan Singaravelan report at bugs.python.org
Thu Sep 27 04:10:55 EDT 2018


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

Thanks for the report and patience. This behavior is still reproducible on master as of f55c64c632 . I am adding Raymond as part of triaging who might have a better explanation about this. Raymond, feel free to remove yourself if this is not relevant.

A slightly cleaned up version of the program with repl statements removed for reference : 

class O(object):
     pass

class M(type):
     pass

class N(type):
     pass

class A(O, metaclass=M):
     pass

class B(O, metaclass=N):
     pass

print(B.__bases__)
print(B.__mro__)

print(type(B))
print(type(A))
print(issubclass(type(B), type(A)))

class C(A, metaclass=N):
     pass

class D(B, A):
     pass

class E(B, metaclass=N):
     pass

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21919>
_______________________________________


More information about the Python-bugs-list mailing list