The core of the abstract base class (ABC) definition is defined in a module named abc. This contains the required decorators and metaclasses to create abstractions. Other classes rely on these definitions. The collections.abc module uses the abc module to create abstractions focused on collections. We'll also look at the numbers module, because it contains ABCs for numeric types. There are ABCs for I/O in the io module, too.
An abstract base class has the following features:
- Abstract means that these classes don't contain all the method definitions required to work completely. For it to be a useful subclass, we will need to provide some method definitions.
- Base means that other classes will use it as a superclass.
- An abstract class provides some definitions for methods. Most importantly, the abstract base classes often provide the signatures for...