OpenQuizz
Une application de gestion des contenus pédagogiques
ChainMap Class Reference
Inheritance diagram for ChainMap:
Collaboration diagram for ChainMap:

Public Member Functions

def __init__ (self, *maps)
 
def __missing__ (self, key)
 
def __getitem__ (self, key)
 
def get (self, key, default=None)
 
def __len__ (self)
 
def __iter__ (self)
 
def __contains__ (self, key)
 
def __bool__ (self)
 
def __repr__ (self)
 
def fromkeys (cls, iterable, *args)
 
def copy (self)
 
def new_child (self)
 
def parents (self)
 
def __setitem__ (self, key, value)
 
def __delitem__ (self, key)
 
def popitem (self)
 
def pop (self, key, *args)
 
def clear (self)
 

Data Fields

 maps
 

Detailed Description

A ChainMap groups multiple dicts (or other mappings) together
to create a single, updateable view.

The underlying mappings are stored in a list.  That list is public and can
accessed or updated using the *maps* attribute.  There is no other state.

Lookups search the underlying mappings successively until a key is found.
In contrast, writes, updates, and deletions only operate on the first
mapping.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
maps 
)
Initialize a ChainMap by setting *maps* to the given mappings.
If no mappings are provided, a single empty dictionary is used.

Member Function Documentation

◆ __bool__()

def __bool__ (   self)

◆ __contains__()

def __contains__ (   self,
  key 
)

◆ __delitem__()

def __delitem__ (   self,
  key 
)

◆ __getitem__()

def __getitem__ (   self,
  key 
)

◆ __iter__()

def __iter__ (   self)

◆ __len__()

def __len__ (   self)

◆ __missing__()

def __missing__ (   self,
  key 
)

◆ __repr__()

def __repr__ (   self)

◆ __setitem__()

def __setitem__ (   self,
  key,
  value 
)

◆ clear()

def clear (   self)

◆ copy()

def copy (   self)

◆ fromkeys()

def fromkeys (   cls,
  iterable,
args 
)

◆ get()

def get (   self,
  key,
  default = None 
)

◆ new_child()

def new_child (   self)

◆ parents()

def parents (   self)

◆ pop()

def pop (   self,
  key,
args 
)

◆ popitem()

def popitem (   self)

Field Documentation

◆ maps

maps

The documentation for this class was generated from the following file: