class documentation

class LazyMappingProxy(Mapping[_K, _V]): (source)

View In Hierarchy

Mapping proxy that delays resolving the target object, until really needed. >>> def obtain_mapping(): ... print("Running expensive function!") ... return {"key": "value", "other key": "other value"} >>> mapping = LazyMappingProxy(obtain_mapping) >>> mapping["key"] Running expensive function! 'value' >>> mapping["other key"] 'other value'

Method __getitem__ Undocumented
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method _target Undocumented
Instance Variable _obtain Undocumented
Instance Variable _value Undocumented
def __getitem__(self, key: _K) -> _V: (source)

Undocumented

def __init__(self, obtain_mapping_value: Callable[[], Mapping[_K, _V]]): (source)

Undocumented

def __iter__(self) -> Iterator[_K]: (source)

Undocumented

def __len__(self) -> int: (source)

Undocumented

def _target(self) -> Mapping[_K, _V]: (source)

Undocumented

Undocumented

Undocumented