temporary_namespace¶
-
utilipy.utils.
temporary_namespace
(locals_ref, keep: List[str] = [])[source]¶ Temporary Namespace within
with
statement.copies current namespace from
locals_ref
Enters
with
statementrestores original namespace except those specified in
keep
- Parameters
- modulemodule
sys.modules[__name__]
of module calling from.Todo
not need to pass any module information. infer.
- keeplist, optional
list of (str) variable names to keep.
- Yields
- locals_reflocals
for accessing namespace
Warning
Does NOT work within functions.