gaupol.AttributeDictionary

Source: gaupol/attrdict.py

Anchestors: aeidon.observable.Observable, builtins.object

class gaupol.AttributeDictionary

Observable dictionary with attribute access to keys.

AttributeDictionary is initialized from a root dictionary, which is kept in sync with attribute values. This allows convenient attribute access to dictionary keys and notifications of changes via the aeidon.Observable interface.

Methods

AttributeDictionary.__init__(root)

Initialize an AttributeDictionary instance.

All subdictionaries of root are initialized as instances of AttributeDictionary as well.

AttributeDictionary.add_attribute(name, value)

Add instance attribute and corresponding root dictionary key.

AttributeDictionary.extend(root)

Add new values from another root dictionary.

AttributeDictionary.remove_attribute(name)

Remove instance attribute and corresponding root dictionary key.

AttributeDictionary.update(root)

Update values from another root dictionary.