Python Class Sequential Inheritance

#Python #OOP

# An experiment on python super
class Base:
    def __init__(self):
        print("Start A")

        print("End A")


class IA(Base):
    def __init__(self):
        print("Start IA")
        super(IA, self).__init__()
        print("End IA")


class IB(IA):
    def __init__(self):
        print("Start IB")
        super(IB, self).__init__()
        print("End IB")


print("Experiment 1:")

ib = IB()

Published: by ;

Authors: LM

Table of Contents

Current Ref:

  • til/programming/python/python-class-inheritance-sequential.md