abc — Abstract Base Classes — PyMOTW 3
Originally posted
· 1 min read
Abstract base classes are a form of interface checking more strict than individual hasattr() checks for particular methods. By defining an abstract base class, a common API can be established for a set of subclasses. This capability is especially useful in situations where someone less familiar with the source for an application is going to provide plug-in extensions, but can also help when working on a large team or with a large code-base where keeping track of all of the classes at the same time is difficult or not possible.
This post is part of the Python Module of the Week series for Python 3. See PyMOTW.com for more articles from the series.