Skip to content

Commit c39ce63

Browse files
pablogsaljonburdo
authored andcommitted
Clarify that every thread has its own default context in contextvars (python#99246)
1 parent db820a2 commit c39ce63

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)