class DataProxy: (source)
Known subclasses: invoke.config.Config
, invoke.context.Context
Helper class implementing nested dict+attr access for `.Config`. Specifically, is used both for `.Config` itself, and to wrap any other dicts assigned as config values (recursively). .. warning:: All methods (of this object or in subclasses) must take care to initialize new attributes via ``self._set(name='value')``, or they'll run into recursion errors! .. versionadded:: 1.0
Class Method | from |
Alternate constructor for 'baby' DataProxies used as sub-dict values. |
Method | __contains__ |
Undocumented |
Method | __delattr__ |
Undocumented |
Method | __delitem__ |
Undocumented |
Method | __eq__ |
Undocumented |
Method | __getattr__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __setattr__ |
Undocumented |
Method | __setitem__ |
Undocumented |
Method | clear |
Undocumented |
Method | pop |
Undocumented |
Method | popitem |
Undocumented |
Method | setdefault |
Undocumented |
Method | update |
Undocumented |
Method | _get |
Undocumented |
Method | _set |
Convenience workaround of default 'attrs are config keys' behavior. |
Method | _track |
Undocumented |
Method | _track |
Undocumented |
Class Variable | _proxies |
Undocumented |
Property | _is |
Undocumented |
Property | _is |
Undocumented |
Alternate constructor for 'baby' DataProxies used as sub-dict values. Allows creating standalone DataProxy objects while also letting subclasses like `.Config` define their own ``__init__`` without muddling the two. :param dict data: This particular DataProxy's personal data. Required, it's the Data being Proxied. :param root: Optional handle on a root DataProxy/Config which needs notification on data updates. :param tuple keypath: Optional tuple describing the path of keys leading to this DataProxy's location inside the ``root`` structure. Required if ``root`` was given (and vice versa.) .. versionadded:: 1.0
Convenience workaround of default 'attrs are config keys' behavior. Uses `object.__setattr__` to work around the class' normal proxying behavior, but is less verbose than using that directly. Has two modes (which may be combined if you really want): - ``self._set('attrname', value)``, just like ``__setattr__`` - ``self._set(attname=value)`` (i.e. kwargs), even less typing.