Code:
class Base(object):
def __init__(self):
print "Base created"
class ChildB(Base):
def __init__(self):
super(ChildB, self).__init__()
Base = ChildB
Base()
When I do Base = ChildB
, Base, in the global frame, points to ChildB
which extends the previous Base
. Since python is a dynamically-typed language, so I assume the hierarchical relationship will change. And MRO that super reference will be ChildB > Base(ChildB) > ChildB > Base(ChildB) ....
But the result tell the truth that ChildB still extends original Base. Why???