Python Class Sequential Inheritance

# 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()

Planted: by ;

No backlinks identified. Reference this note using the Note ID til/programming/python/python-class-inheritance-sequential.md in other notes to connect them.

LM (2020). 'Python Class Sequential Inheritance', Datumorphism, 12 April. Available at: https://datumorphism.leima.is/til/programming/python/python-class-inheritance-sequential/.