__init__() is not invoked automatically when the subclass is instantiated. : Subclass : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Subclass »

 

__init__() is not invoked automatically when the subclass is instantiated.


class P(object):
    def __init__(self):
        print "calling P's constructor"

class C(P):
    def __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
» Subclass