picop.cycontextvars#
contextvars helpers.
- picop.cycontextvars.context_eq(a, b)#
Return True if
Contextvalues match (identity + richcompare; same asContext.__eq__). :type a:object:param a: :type b:object:param b:- Return type:
- picop.cycontextvars.ctx_check_exact(obj)#
Return True if
type(obj) is contextvars.Context. :type obj:object:param obj:- Return type:
- picop.cycontextvars.ctx_copy(ctx)#
Return a copy of
ctx(PyContext_Copy). :type ctx:object:param ctx:- Return type:
- picop.cycontextvars.ctx_copy_current()#
Return a copy of the current context (
PyContext_CopyCurrent).- Return type:
- picop.cycontextvars.ctx_enter(ctx)#
Enter context
ctx(PyContext_Enter).Notes
Returns
0on success; errors raise — do not use the status as a bool.
- picop.cycontextvars.ctx_exit(ctx)#
Exit context
ctx(PyContext_Exit).Notes
Returns
0on success; errors raise — do not use the status as a bool.
- picop.cycontextvars.ctxtoken_check_exact(obj)#
Return True if
type(obj) is contextvars.Token. :type obj:object:param obj:- Return type:
- picop.cycontextvars.ctxvar_check_exact(obj)#
Return True if
type(obj) is contextvars.ContextVar. :type obj:object:param obj:- Return type:
- picop.cycontextvars.ctxvar_new(name, default_value=None)#
Return a new
ContextVar(PyContextVar_New).Notes
namemust bebytes, notstr.
- picop.cycontextvars.ctxvar_reset(var, token)#
Reset
varusingtoken(PyContextVar_Reset).Notes
Returns
0on success; errors raise — do not use the status as a bool.