mirror of https://github.com/python/cpython
Clarify that every thread has its own default context in contextvars (#99246)
This commit is contained in:
parent
d98ca8172c
commit
cb60b6131b
|
@ -144,6 +144,11 @@ Manual Context Management
|
|||
To get a copy of the current context use the
|
||||
:func:`~contextvars.copy_context` function.
|
||||
|
||||
Every thread will have a different top-level :class:`~contextvars.Context`
|
||||
object. This means that a :class:`ContextVar` object behaves in a similar
|
||||
fashion to :func:`threading.local()` when values are assigned in different
|
||||
threads.
|
||||
|
||||
Context implements the :class:`collections.abc.Mapping` interface.
|
||||
|
||||
.. method:: run(callable, *args, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue