class documentation

class DictClass(dict):

Constructor: DictClass(*args, **kwargs)

View In Hierarchy

A class wrapped over dict to use class .-notation.

>>> from cma.utilities.utils import DictClass
>>> dict_ = dict((3 * c, c) for c in 'abcd')
>>> as_class = DictClass(dict_)
>>> assert as_class.__dict__ == dict_ == as_class
>>> assert as_class.aaa == 'a'
>>> as_class.new = 33
>>> assert 'new' in as_class
>>> as_class['nnew'] = 44
>>> assert as_class.nnew == 44
>>> assert len(as_class) == 6
Method __dir__ Undocumented
Method __init__ Undocumented
Instance Variable __dict__ Undocumented
def __dir__(self):

Undocumented

def __init__(self, *args, **kwargs):

Undocumented

__dict__ =

Undocumented