Skip to content

Class tigrbl.config.resolver.CfgView

tigrbl.config.resolver.CfgView

CfgView(data)

Read-only attribute/dict view over a plain dict. Unknown attributes return None (to play nicely with getattr(cfg, 'x', None)).

Source code in tigrbl/config/resolver.py
50
51
52
def __init__(self, data: Mapping[str, Any]):
    # freeze top-level mapping
    self._data = MappingProxyType(dict(data))

get

get(key, default=None)
Source code in tigrbl/config/resolver.py
60
61
def get(self, key: str, default: Any = None) -> Any:
    return self._data.get(key, default)

as_dict

as_dict()

Copy out a mutable dict (for diagnostics/serialization).

Source code in tigrbl/config/resolver.py
63
64
65
def as_dict(self) -> Dict[str, Any]:
    """Copy out a mutable dict (for diagnostics/serialization)."""
    return dict(self._data)