Just a Class Diagram for Python 3 Collections Abstract Base Classes
The class diagram depicts the main classes in Python’s collections.abs module and their relationship with built-in container types.
Join the DZone community and get the full member experience.
Join For Free
Python’s built-in container types such as tuple
, str
, bytes
, list
, set
, and dict
show well why Python is so popular. They cover all the usage in view of mutability and item order, and the operations and behaviors are really intuitive, expressive, and concise. Especially slice notation and high-order functions on these container types are even beautiful.
In Python, these container types are generalized by abstract base classes mechanism to be extended easily. The above class diagram depicts the main classes in Python’s collections.abs
module and their relationship with built-in container types.
The diagram is drawn using PlantUML and the source (in plain text) of it is here.
Opinions expressed by DZone contributors are their own.
Comments