jgdv.structs.chainguard.proxies.failure
- A Proxy for ChainGuard,
which allows you to use the default attribute access (data.a.b.c) even when there might not be an a.b.c path in the data.
Thus: data.on_fail(default_value).a.b.c()
Note: To distinguish between not giving a default value, and giving a default value of None, wrap the default value in a tuple: (None,)
Type Aliases
Classes
A Wrapper for guarded access to toml values. |
Module Contents
- jgdv.structs.chainguard.proxies.failure.Wrapper: TypeAlias = Callable[[TomlTypes], Any]
- class jgdv.structs.chainguard.proxies.failure.GuardFailureProxy(
- data,
- types=None,
- index=None,
- fallback=NO_FALLBACK,
Bases:
jgdv.structs.chainguard.proxies.base.GuardProxyA Wrapper for guarded access to toml values. you get the value by calling it. Until then, it tracks attribute access, and reports that to GuardBase when called. It also can type check its value and the value retrieved from the toml data