Module 9 Overview
Module 9: Inheritance explores how to create specialized versions of existing classes. This is a key pillar of OOP that promotes code reuse and logical hierarchy.
In this module, we will learn how to base a new class on an existing one, how to override behavior, and how to define contracts for what a class must do using Abstract Base Classes.
Learning Objectives
Section titled “Learning Objectives”By the end of this module, you will be able to:
- Create Subclasses that inherit attributes and methods from Parent classes.
- Use
super()to extend parent functionality without replacing it entirely. - Understand Polymorphism and how different objects can respond to the same method call.
- Navigate Multiple Inheritance and the Method Resolution Order (MRO).
- Define Abstract Base Classes (ABCs) to enforce interface standards.
Module Contents
Section titled “Module Contents” Basic Inheritance Creating subclasses and using super().
Polymorphism Overriding methods and flexible interfaces.
Multiple Inheritance Inheriting from more than one parent and the MRO.
Abstract Base Classes Defining strict blueprints with the abc module.