With & Without Abstract Classes

Python: Five Basic Built-In Methods

Writing Code in ABC

Logging w/ Abstract Classes


@abstractmethod

@abstractstaticmethod

@abstractproperty

@abstractclassmethod


Relevant pages

Python Polymorphism

Python Decorators

Python Interfaces


How to Write More Extensible Data Pipelines with the @abstractmethod in Python

Why use Abstract Base Classes in Python?



ABCs for Non-Coders

Explain it Like I’m 5

Complex ABC Example (most helpful)

Key Terms

  1. Abstract class:

    An Abstract class is a template that enforces a common interface and forces classes that inherit from it to implement a set of methods and properties. The Python abc module provides the functionalities to define and use abstract classes.

  2. Naming Convention Consistency & Readability (source)

    Without the abstract class Shape, each shape class would have its own naming conventions for methods and attributes. This would lead to inconsistency, making it challenging for developers to remember and use the correct methods for each shape

Basic Ideas