Content-Length: 270994 | pFad | http://github.com/python/cpython/commit/a757c1b7d3dfec875be15f8bd83777142d75b376

D5 Clarify that every thread has its own default context in contextvars … · python/cpython@a757c1b · GitHub
Skip to content

Commit a757c1b

Browse files
Clarify that every thread has its own default context in contextvars (GH-99246)
(cherry picked from commit cb60b61) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
1 parent 53063b7 commit a757c1b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/contextvars.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ Manual Context Management
144144
To get a copy of the current context use the
145145
:func:`~contextvars.copy_context` function.
146146

147+
Every thread will have a different top-level :class:`~contextvars.Context`
148+
object. This means that a :class:`ContextVar` object behaves in a similar
149+
fashion to :func:`threading.local()` when values are assigned in different
150+
threads.
151+
147152
Context implements the :class:`collections.abc.Mapping` interface.
148153

149154
.. method:: run(callable, *args, **kwargs)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/commit/a757c1b7d3dfec875be15f8bd83777142d75b376

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy