module documentation

Undocumented

Class Local Create a namespace of context-local data. This wraps a :class:`ContextVar` containing a :class:`dict` value.
Class LocalManager Manage releasing the data for the current context in one or more :class:`Local` and :class:`LocalStack` objects.
Class LocalProxy A proxy to the object bound to a context-local object. All operations on the proxy are forwarded to the bound object. If no object is bound, a ``RuntimeError`` is raised.
Class LocalStack Create a stack of context-local data. This wraps a :class:`ContextVar` containing a :class:`list` value.
Function release_local Release the data for the current context in a :class:`Local` or :class:`LocalStack` without using a :class:`LocalManager`.
Type Variable F Undocumented
Type Variable T Undocumented
Class _ProxyIOp Look up an augmented assignment method on a proxied object. The method is wrapped to return the proxy instead of the object.
Class _ProxyLookup Descriptor that handles proxied attribute lookup for :class:`LocalProxy`.
Function _identity Undocumented
Function _l_to_r_op Swap the argument order to turn an l-op into an r-op.
def release_local(local: t.Union[Local, LocalStack]): (source)

Release the data for the current context in a :class:`Local` or :class:`LocalStack` without using a :class:`LocalManager`. This should not be needed for modern use cases, and may be removed in the future. .. versionadded:: 0.6.1

Undocumented

Value
t.TypeVar('F',
          bound=t.Callable[..., t.Any])

Undocumented

Value
t.TypeVar('T')
def _identity(o: T) -> T: (source)

Undocumented

def _l_to_r_op(op: F) -> F: (source)

Swap the argument order to turn an l-op into an r-op.