June 2019
Beginner to intermediate
770 pages
19h 24m
English
Python has a built-in mapping called dict, and numerous library mappings. In addition to the collections module extensions to dict (defaultdict, Counter, and ChainMap), there are several other library modules that contain mapping-like structures.
The shelve module is an important example of another mapping. We'll look at this in Chapter 11, Storing and Retrieving Objects via Shelve. The dbm module is similar to shelve, in that it also maps a key to a value.
The mailbox module and email.message modules both have classes that provide an interface that is similar to dict for the mailbox structure used to manage local e-mails.
As far as design strategies go, we can extend or wrap one of the existing mappings to ...
Read now
Unlock full access