diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2022-12-20 11:35:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-20 11:35:48 (GMT) |
commit | cb60b6131bc2bb11c48a15f808914d8b242b9fc5 (patch) | |
tree | bfcb7644b6dbcfff7035c80f95056e085a0aa740 /Doc/library | |
parent | d98ca8172c39326bb200308a5191ceeb4a262d53 (diff) | |
download | cpython-cb60b6131bc2bb11c48a15f808914d8b242b9fc5.zip cpython-cb60b6131bc2bb11c48a15f808914d8b242b9fc5.tar.gz cpython-cb60b6131bc2bb11c48a15f808914d8b242b9fc5.tar.bz2 |
Clarify that every thread has its own default context in contextvars (#99246)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/contextvars.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/contextvars.rst b/Doc/library/contextvars.rst index 08a7c7d..0ac2f3d 100644 --- a/Doc/library/contextvars.rst +++ b/Doc/library/contextvars.rst @@ -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) |