The ABCs of Collections
Learn about the Python collections module's Container ABC, allowing in-keyword use and duck typing for versatile class relationships.
We'll cover the following
A really comprehensive use of the abstract base classes in the Python standard library lives in the collections
module. The collections we use are extensions of the Collection
abstract class. Collection
is an extension of an even more fundamental abstraction, Container
.
Since the foundation is the Container
class, let’s inspect it in the Python interpreter to see what methods this class requires:
Get hands-on with 1400+ tech skills courses.