@@ -260,19 +260,33 @@ Glossary
260260 advanced mathematical feature. If you're not aware of a need for them,
261261 it's almost certain you can safely ignore them.
262262
263+ context
264+ This term has different meanings depending on where and how it is used.
265+ Some common meanings:
266+
267+ * The temporary state or environment established by a :term: `context
268+ manager ` via a :keyword: `with ` statement.
269+ * The collection of keyvalue bindings associated with a particular
270+ :class: `contextvars.Context ` object and accessed via
271+ :class: `~contextvars.ContextVar ` objects. Also see :term: `context
272+ variable `.
273+ * A :class: `contextvars.Context ` object. Also see :term: `current
274+ context `.
275+
276+ context management protocol
277+ The :meth: `~object.__enter__ ` and :meth: `~object.__exit__ ` methods called
278+ by the :keyword: `with ` statement. See :pep: `343 `.
279+
263280 context manager
264- An object which controls the environment seen in a :keyword: ` with `
265- statement by defining :meth: ` ~object.__enter__ ` and :meth: ` ~object.__exit__ ` methods.
266- See :pep: `343 `.
281+ An object which implements the :term: ` context management protocol ` and
282+ controls the environment seen in a :keyword: ` with ` statement. See
283+ :pep: `343 `.
267284
268285 context variable
269- A variable which can have different values depending on its context.
270- This is similar to Thread-Local Storage in which each execution
271- thread may have a different value for a variable. However, with context
272- variables, there may be several contexts in one execution thread and the
273- main usage for context variables is to keep track of variables in
286+ A variable whose value depends on which context is the :term: `current
287+ context `. Values are accessed via :class: `contextvars.ContextVar `
288+ objects. Context variables are primarily used to isolate state between
274289 concurrent asynchronous tasks.
275- See :mod: `contextvars `.
276290
277291 contiguous
278292 .. index :: C-contiguous, Fortran contiguous
@@ -306,6 +320,14 @@ Glossary
306320 is used when necessary to distinguish this implementation from others
307321 such as Jython or IronPython.
308322
323+ current context
324+ The :term: `context ` (:class: `contextvars.Context ` object) that is
325+ currently used by :class: `~contextvars.ContextVar ` objects to access (get
326+ or set) the values of :term: `context variables <context variable> `. Each
327+ thread has its own current context. Frameworks for executing asynchronous
328+ tasks (see :mod: `asyncio `) associate each task with a context which
329+ becomes the current context whenever the task starts or resumes execution.
330+
309331 decorator
310332 A function returning another function, usually applied as a function
311333 transformation using the ``@wrapper `` syntax. Common examples for
0 commit comments