Skip to content

Instantly share code, notes, and snippets.

@crast
Created May 21, 2012 18:44
Show Gist options
  • Save crast/2763872 to your computer and use it in GitHub Desktop.
Save crast/2763872 to your computer and use it in GitHub Desktop.
class Form(object):
def __init__(self):
print "Form init called"
class SessionSecureForm(Form):
def __init__(self):
print "SessionSecureForm about to call super"
super(SessionSecureForm, self).__init__()
print "SessionSecureForm returned from super"
class I18NForm(Form):
def __init__(self):
print "I18NForm about to call Super"
super(I18NForm, self).__init__()
print "I18NForm back from super"
class BaseForm1(SessionSecureForm, I18NForm):
pass
class BaseForm2(SessionSecureForm, I18NForm):
def __init__(self):
print "Baseform2 about to call super"
super(BaseForm2, self).__init__()
print "Baseform2 back from super"
class BaseForm3(SessionSecureForm, I18NForm, Form):
def __init__(self):
print "Baseform3 about to call super"
super(BaseForm3, self).__init__()
print "Baseform3 back from super"
print "######### Simple multiple test"
BaseForm1()
print ""
print "######### multiple test with extra init"
BaseForm2()
print ""
print "######### Extra base multiple test"
BaseForm3()
######### Simple multiple test
SessionSecureForm about to call super
I18NForm about to call Super
Form init called
I18NForm back from super
SessionSecureForm returned from super
######### multiple test with extra init
Baseform2 about to call super
SessionSecureForm about to call super
I18NForm about to call Super
Form init called
I18NForm back from super
SessionSecureForm returned from super
Baseform2 back from super
######### Extra base multiple test
Baseform3 about to call super
SessionSecureForm about to call super
I18NForm about to call Super
Form init called
I18NForm back from super
SessionSecureForm returned from super
Baseform3 back from super
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment