With & Without Abstract Classes
Python: Five Basic Built-In Methods
Relevant pages
How to Write More Extensible Data Pipelines with the @abstractmethod in Python
Why use Abstract Base Classes in Python?
Complex ABC Example (most helpful)
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.
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