Skip to content

Instantly share code, notes, and snippets.

@invkrh
Created August 8, 2019 15:54
Show Gist options
  • Save invkrh/e6c2193d488a9fb9e27423a28bfa82d2 to your computer and use it in GitHub Desktop.
Save invkrh/e6c2193d488a9fb9e27423a28bfa82d2 to your computer and use it in GitHub Desktop.
class Type(type):
def __repr__(cls):
return cls.__name__
class O(object, metaclass=Type): pass
class A(O): pass
class B(O): pass
class C(O): pass
class D(O): pass
class E(O): pass
class K1(A, B, C): pass
class K2(D, B, E): pass
class K3(D, A): pass
class Z(K1, K2, K3): pass
Z.mro()
[Z, K1, K2, K3, D, A, B, C, E, O, <class 'object'>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment