Dev with Serdar
Learn coding in Python, Go and Rust from Serdar Yegulalp, software dev specialist and senior writer at InfoWorld.
The power of Pythonβs abstract base classes
Overview
Python's "abstract base class" system gives you a way to create types that serve as the abstract foundation for another, more concrete type. This example shows how an abstract base class from the Python standard library can be used as the basis for a custom dictionary type, one where the entries expire after a given length of time, and where the implementation is less clumsy and unpredictable than just subclassing the built-in dict type.


