Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb60b61

Browse files
authored
Clarify that every thread has its own default context in contextvars (#99246)
1 parentd98ca81 commitcb60b61

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)

[8]ページ先頭

©2009-2025 Movatter.jp