6.5 Recall
Here are some of the key points in this chapter:
-
Using ABC definitions is a way to create class definitions with placeholders. This is a handy technique, and can be somewhat clearer than using raise NotImplementedError in unimplemented methods.
-
ABCs and type hints provide ways to create class definitions. An ABC is a type hint that can help to clarify the essential features we need from an object. It’s common, for example, to use Iterable[X] to emphasize that we need one aspect of a class implementation.
-
The collections.abc module defines ABCs for Python’s built-in collections. When we want to make our own unique collect class that can integrate seamlessly with Python, we need to start with the definitions from this module.
-
Creating your own ABC leverages the abc module. The abc.ABC class definition is often a perfect starting point for...