If you want the base class __init__() invoked : Constructor : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Constructor »

 

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()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Class
» Constructor