Last active
December 19, 2017 16:07
-
-
Save melvyniandrag/3a1f5eddff58fdc902c9e32046f89d26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A( object ): | |
def __init__( self ): | |
print("A") | |
super( A, self ).__init__() | |
class B( object ): | |
def __init__( self ): | |
print("B") | |
super( B, self ).__init__() | |
class C( object ): | |
def __init__( self ): | |
print("C") | |
super( C, self ).__init__() | |
class D( object ): | |
def __init__( self ): | |
print("D") | |
super( D, self ).__init__() | |
class E( object ): | |
def __init__( self ): | |
print("E") | |
super( E, self ).__init__() | |
class K1( A, B, C ): | |
def __init__( self ): | |
print("K1") | |
super( K1, self ).__init__() | |
class K2( D, B, E ): | |
def __init__( self ): | |
print("K2") | |
super( K2, self ).__init__() | |
class K3( D, A ): | |
def __init__( self ): | |
print("K3") | |
super( K3, self ).__init__() | |
class Z( K1, K2, K3): | |
def __init__( self ): | |
print("Z") | |
super( Z, self ).__init__() | |
print( Z.mro() ) | |
z = Z() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A bit of code to verify the explanation of c3 linearization I found on wikipedia.