December 2018
Beginner to intermediate
796 pages
19h 54m
English
When Python general purpose built-in containers (tuple, list, set, and dict) aren't enough, we can find specialized container datatypes in the collections module. They are:
| Data type | Description |
|
namedtuple() |
Factory function for creating tuple subclasses with named fields |
|
deque |
List-like container with fast appends and pops on either end |
|
ChainMap |
Dictionary-like class for creating a single view of multiple mappings |
|
Counter |
Dictionary subclass for counting hashable objects |
|
OrderedDict |
Dictionary subclass that remembers the order entries were added |
|
defaultdict |
Dictionary subclass that calls a factory function to supply missing values |
|
UserDict |
Wrapper around dictionary objects ... |
Read now
Unlock full access