Skip to content

Instantly share code, notes, and snippets.

@tbarbugli
Created June 3, 2013 15:56
Show Gist options
  • Save tbarbugli/5699158 to your computer and use it in GitHub Desktop.
Save tbarbugli/5699158 to your computer and use it in GitHub Desktop.
class A(object):
def __init__(self):
super(A, self).__init__()
print 'class A'
class B(object):
def __init__(self):
super(B, self).__init__()
print 'class B'
class A2(A):
def __init__(self):
super(A2, self).__init__()
print 'class A2'
class B2(B):
def __init__(self):
super(B2, self).__init__()
print 'class B2'
class C(A2, B2):
def __init__(self):
super(C, self).__init__()
print 'class C'
C()
@pterk
Copy link

pterk commented Jun 3, 2013

class A(object):
def init(self):
print self
def throw_bananas(self):
#super(A, self).throw_bananas()
print 'class A'

class B(object):
def init(self):
print self
def throw_bananas(self):
super(B, self).throw_bananas()
print 'class B'

class A2(A):
def init(self):
print self
def throw_bananas(self):
super(A2, self).throw_bananas()
print 'class A2'

class B2(B):
def init(self):
print self
def throw_bananas(self):
super(B2, self).throw_bananas()
print 'class B2'

class C(A2, B2):
def init(self):
print self
def throw_bananas(self):
super(C, self).throw_bananas()
print 'class C'

C().throw_bananas()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment