Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 699 Bytes

File metadata and controls

13 lines (9 loc) · 699 Bytes

Chain Map

  • Python’s ChainMap from the collections module provides an efficient tool for managing several dictionaries as a single one. This class is handy when you have multiple dictionaries representing different scopes or contexts and need to set access priorities to the underlying data.

  • ChainMap groups multiple dictionaries and mappings in an updatable view that works pretty much like a dictionary. You can use ChainMap objects to efficiently work with several dictionaries, define key lookup priorities, and manage multiple contexts in Python.

Examples