We'll look at some extensions to built-in classes that are already part of the standard library. These are the collections that extend or modify the built-in collections. Most of these are covered in one form or another in books such as Python 3 Object-Oriented Programming - Third Edition by Dusty Phillips.
We'll look at the following four collection from this library:
- deque (note the atypical class name) is a double-ended queue, a list-like collection that can perform fast appends and pops on either end. A subset of the features of this class will create single-ended stacks or queues.
- ChainMap is a view of multiple mappings. Instead of merging mappings together, we can keep them separate and chain among them to locate which mapping contains a requested key.
- defaultdict (note the atypical spelling) is a dict subclass that uses...