]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-32995 - Added context variable in glossary (GH-9741)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 14 May 2019 12:24:42 +0000 (05:24 -0700)
committerGitHub <noreply@github.com>
Tue, 14 May 2019 12:24:42 +0000 (05:24 -0700)
(cherry picked from commit c0a1a07c7e9814cad79cce3580c16284b2df7f52)

Co-authored-by: Vinodhini Balusamy <me.vinob@gmail.com>
Doc/glossary.rst
Misc/NEWS.d/next/Documentation/2018-10-07-03-04-57.bpo-32995.TXN9ur.rst [new file with mode: 0644]

index 9ca46222ad9bda36ee59f5197af40c2cf6138299..b6ab28617d142d00b68f1882c80a478c936e54c7 100644 (file)
@@ -221,6 +221,15 @@ Glossary
       statement by defining :meth:`__enter__` and :meth:`__exit__` methods.
       See :pep:`343`.
 
+    context variable
+      A variable which can have different values depending on its context.
+      This is similar to Thread-Local Storage in which each execution
+      thread may have a different value for a variable. However, with context
+      variables, there may be several contexts in one execution thread and the
+      main usage for context variables is to keep track of variables in
+      concurrent asynchronous tasks.
+      See :mod:`contextvars`.
+
    contiguous
       .. index:: C-contiguous, Fortran contiguous
 
diff --git a/Misc/NEWS.d/next/Documentation/2018-10-07-03-04-57.bpo-32995.TXN9ur.rst b/Misc/NEWS.d/next/Documentation/2018-10-07-03-04-57.bpo-32995.TXN9ur.rst
new file mode 100644 (file)
index 0000000..1df5eea
--- /dev/null
@@ -0,0 +1 @@
+Added the context variable in glossary.