consequences of not calling object.__init__?

John Lenton jlenton at gmail.com
Tue Dec 28 20:16:07 CET 2004


in the code that follows, instances of E haven't been through D's
rigorous initiation process

.    class C(object):
.        def __init__(self):
.            print "C"
.
.    class D(object):
.        def __init__(self):
.            print "D"
.            super(D, self).__init__()
.
.    class E(C, D):
.        def __init__(self):
.            print "E"
.            super(E, self).__init__()




More information about the Python-list mailing list