]> granicus.if.org Git - python/commitdiff
bpo-32995 - Added context variable in glossary (GH-9741)
authorVinodhini Balusamy <me.vinob@gmail.com>
Tue, 14 May 2019 12:11:41 +0000 (22:11 +1000)
committerCheryl Sabella <cheryl.sabella@gmail.com>
Tue, 14 May 2019 12:11:41 +0000 (08:11 -0400)
Doc/glossary.rst
Misc/NEWS.d/next/Documentation/2018-10-07-03-04-57.bpo-32995.TXN9ur.rst [new file with mode: 0644]

index 9c64e4886319620dee742f99b3cd094bf813ad90..d3ce36525519986c36facdc0da37c54bd460bec8 100644 (file)
@@ -225,6 +225,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.