Understanding Python super() with __init__() methods
Asked 07 September, 2021
Viewed 1.7K times
  • 65
Votes

I'm curious to know about the actual difference between the following 2 child classes.

class Base(object):
    def __init__(self):
        print "Base created"

class ChildA(Base):
    def __init__(self):
        Base.__init__(self)

class ChildB(Base):
    def __init__(self):
        super(ChildB, self).__init__()

ChildA() 
ChildB()

7 Answer