Specialized data containers from the collections module

Every data structure has its shortcomings. There is no single collection that can suit every problem, and four basic types of them (tuple, list, set, and dictionary) is still not a wide range of choices. These are the most basic and important collections that have a dedicated literal syntax. Fortunately, Python provides far more options in its standard library through the collections built-in module. Here are the most important universal data containers provided by this module:

More details on selected collections from the collections module and some advice on where it is worth using them is provided in Chapter 14, Optimization – Some Powerful Techniques.