Mega Code Archive

 
Categories / Python Tutorial / Class
 

If you want the base class __init__() invoked

class P(object):     def __init__(self):         print "calling P's constructor" class C(P):     def __init__(self):         P.__init__(self)         print "calling C's constructor" c = C()