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

Public Member Functions

def __init__ (self, items=())
 
def __getitem__ (self, key)
 
def __get__ (self, instance, owner=None)
 

Data Fields

 default
 

Detailed Description

Dict with 2 special properties:

On initiation, keys that are lists, sets or tuples are converted to
multiple keys so accessing any one of the items in the original
list-like object returns the matching value

md = MethodDispatcher({("foo", "bar"):"baz"})
md["foo"] == "baz"

A default value which can be set through the default attribute.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  items = () 
)

Member Function Documentation

◆ __get__()

def __get__ (   self,
  instance,
  owner = None 
)

◆ __getitem__()

def __getitem__ (   self,
  key 
)

Field Documentation

◆ default

default

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