The collections module
When Python general purpose built-in containers (tuple
, list
, set
, and dict
) aren't enough, we can find specialized container data types in the collections
module. They are:
Data type |
Description |
---|---|
|
A factory function for creating tuple subclasses with named fields |
|
A |
|
A |
|
A |
|
A |
|
A |
|
A wrapper around dictionary objects for easier dict subclassing |
|
A wrapper around list objects for easier list subclassing |
|
A wrapper around string objects for easier string subclassing |
We don't have the room to cover all of them, but you can find plenty of examples in the official documentation...