I'm studying super()
What is the difference between ChildA() and
ChildB()
in the code below?
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__()
super()
prevents explicit reference to the base class.
It is valuable in multiple inheritance environments.
Check out standard docs
© 2024 OneMinuteCode. All rights reserved.