class documentation
class Local: (source)
Create a namespace of context-local data. This wraps a :class:`ContextVar` containing a :class:`dict` value. This may incur a performance penalty compared to using individual context vars, as it has to copy data to avoid mutating the dict between nested contexts. :param context_var: The :class:`~contextvars.ContextVar` to use as storage for this local. If not given, one will be created. Context vars not created at the global scope may interfere with garbage collection. .. versionchanged:: 2.0 Uses ``ContextVar`` instead of a custom storage implementation.
Method | __call__ |
Create a :class:`LocalProxy` that access an attribute on this local namespace. |
Method | __delattr__ |
Undocumented |
Method | __getattr__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __release |
Undocumented |
Method | __setattr__ |
Undocumented |
Class Variable | __slots__ |
Undocumented |