This module implements specialized container datatypes providing alternatives to Python’s general purpose built-in containers,
dict, list, set, and tuple.
Following are the most commonly used special container types of collections module,
|Counter||dict subclass for counting hashable objects|
|OrderedDict||dict subclass that remembers the order entries were added|
|defaultdict||dict subclass that calls a factory function to supply missing values|
|deque||list-like container with fast appends and pops on either end|
|namedtuple||factory function for creating tuple subclasses with named fields|
We can also implement a custom container type like
OrderedCounter using the container types provided by collections module.
The next series of posts will dive deep into the above mentioned container types provided by collections module.
Stay Tuned !