gh-125512: Revert "gh-124872: Replace enter/exit events with "switched" (#124776)" (#125513)

This commit is contained in:
Kirill Podoprigora 2024-10-15 17:42:16 +03:00 committed by GitHub
parent 55c4f4c30b
commit d3c82b9cce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 118 additions and 118 deletions

View file

@ -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