summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorKirill Podoprigora <kirill.bast9@mail.ru>2024-10-15 14:42:16 (GMT)
committerGitHub <noreply@github.com>2024-10-15 14:42:16 (GMT)
commitd3c82b9ccedd77fc302f5ab8ab0220b3372f574c (patch)
treeee15c5f380dadeac8ee875abbc73b20f8067a12e /Doc
parent55c4f4c30b49734ce35dc88139b8b4fdc94c66fd (diff)
downloadcpython-d3c82b9ccedd77fc302f5ab8ab0220b3372f574c.zip
cpython-d3c82b9ccedd77fc302f5ab8ab0220b3372f574c.tar.gz
cpython-d3c82b9ccedd77fc302f5ab8ab0220b3372f574c.tar.bz2
gh-125512: Revert "gh-124872: Replace enter/exit events with "switched" (#124776)" (#125513)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/contextvars.rst14
1 files changed, 10 insertions, 4 deletions
diff --git a/Doc/c-api/contextvars.rst b/Doc/c-api/contextvars.rst
index b7c6550..8eba54a 100644
--- a/Doc/c-api/contextvars.rst
+++ b/Doc/c-api/contextvars.rst
@@ -123,10 +123,16 @@ Context object management functions:
Enumeration of possible context object watcher events:
- - ``Py_CONTEXT_SWITCHED``: The :term:`current context` has switched to a
- different context. The object passed to the watch callback is the
- now-current :class:`contextvars.Context` object, or None if no context is
- current.
+ - ``Py_CONTEXT_EVENT_ENTER``: A context has been entered, causing the
+ :term:`current context` to switch to it. The object passed to the watch
+ callback is the now-current :class:`contextvars.Context` object. Each
+ enter event will eventually have a corresponding exit event for the same
+ context object after any subsequently entered contexts have themselves been
+ exited.
+ - ``Py_CONTEXT_EVENT_EXIT``: A context is about to be exited, which will
+ cause the :term:`current context` to switch back to what it was before the
+ context was entered. The object passed to the watch callback is the
+ still-current :class:`contextvars.Context` object.
.. versionadded:: 3.14