Python · Classes and Object Design · Intermediate · 26 min read
Python Abstract Base Classes: abc, abstractmethod, Virtual Subclasses and Designing Interfaces
Define and enforce interfaces in Python. Learn ABC and abstractmethod, abstract properties and class methods, how incomplete subclasses fail early, the template method pattern, register and __subclasshook__ for virtual subclasses, the collections.abc hierarchy, ABCs versus Protocols versus duck typing, and design guidance for plug-in architectures.
Create an account to start
Create a free account to see what this lesson covers
- Every free lesson in every section, in full
- Track your progress and pick up where you left off
- Free practice questions and an incident simulation
- Takes under a minute: name, email and a password
No card needed. Full access to Python is a paid upgrade you can choose later.