Skip to content

Commit 1332fda

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 ba8e30c commit 1332fda

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/contextvars.rst

+5
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)