Skip to main content
Loading page…
Python Mastery
Chapter 14
Lesson 4 of 4
Abstract Base Classes & Enums
Contents
Notes
Tutor
Concept
What Is an Abstract Base Class?
Loading activity…
Previous
1 / 9
Continue
Contents
Notes
Discussion
Tutor
26 min
9 activities
0 of 9 done
In this lesson
1
What Is an Abstract Base Class?
2
Concrete Shapes Implementing the Shape ABC
3
enum.Enum: Named Constants with Superpowers
4
Combining ABCs and Enums in a Payment System
5
ABCs and Enums Quiz
6
ABC vs Protocol: Know the Difference
7
Implement an Animal ABC with Enum
8
Design Reflection: ABC or Duck Typing?
9
What's Next: typing.Protocol for Structural Subtyping
Objectives
Define an interface using abc.ABC and @abstractmethod, preventing direct instantiation
Verify at runtime that a concrete class has implemented all required methods
Model a fixed set of named constants using enum.Enum and explain why this beats plain strings
Use auto(), IntEnum, and Flag for common enum patterns
Chapter 14 · Advanced OOP
Dunder (Magic) Methods
Properties & Computed Attributes
Dataclasses
Abstract Base Classes & Enums
Previous: Dataclasses
Next: The Descriptor Protocol