PyMOTW-3
  • Module Index
  • Index
  • Data Structures

collections — Container Data Types¶

Purpose:Container data types.

The collections module includes container data types beyond the built-in types list, dict, and tuple.

  • ChainMap — Search Multiple Dictionaries
  • Counter — Count Hashable Objects
  • defaultdict — Missing Keys Return a Default Value
  • deque — Double-Ended Queue
  • namedtuple — Tuple Subclass with Named Fields
  • OrderedDict — Remember the Order Keys are Added to a Dictionary
  • collections.abc — Abstract Base Classes for Containers

See also

  • Standard library documentation for collections
  • Python 2 to 3 porting notes for collections
  • PEP 342 – Coroutines via Enhanced Generators
  • PEP 492 – Coroutines with async and await syntax
enum – Enumeration Type ChainMap — Search Multiple Dictionaries
This page was last updated 2016-12-31.
Navigation
  • enum – Enumeration Type
  • ChainMap — Search Multiple Dictionaries

Get the book

The output from all the example programs from PyMOTW-3 has been generated with Python 3.7.9, unless otherwise noted. Some of the features described here may not be available in earlier versions of Python.

Looking for examples for Python 2?

This Site

  • Module Index
  • Index
© Copyright 2021, Doug Hellmann
Creative Commons License BY-NC-SA

Other Writing

  • Blog
  • The Python Standard Library By Example