warg.context_wrapper.ContextWrapper

class warg.context_wrapper.ContextWrapper(context_manager: ContextManager, enabled: bool, construction_args: Sequence = (), construction_kwargs: Mapping | None = None)[source]

Bases: AbstractContextManager

Allows for conditional application of contexts, if uninstantiated context manager classes are passed no arguments is supplied in construction. if disabled, None is returned if enabled return of context manager is propagated

__init__(context_manager: ContextManager, enabled: bool, construction_args: Sequence = (), construction_kwargs: Mapping | None = None)[source]

Methods

__init__(context_manager, enabled[, ...])