-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3.13] gh-126451: Register contextvars.Context to collections.abc.Map…
…ping (GH-126452) (#126518) gh-126451: Register contextvars.Context to collections.abc.Mapping (GH-126452) (cherry picked from commit 5dc36dc) Co-authored-by: Stephen Morton <[email protected]> Co-authored-by: sobolevn <[email protected]> Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Peter Bierma <[email protected]>
- Loading branch information
1 parent
9e115b1
commit 59316a6
Showing
3 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
import _collections_abc | ||
from _contextvars import Context, ContextVar, Token, copy_context | ||
|
||
|
||
__all__ = ('Context', 'ContextVar', 'Token', 'copy_context') | ||
|
||
|
||
_collections_abc.Mapping.register(Context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2024-11-05-11-28-45.gh-issue-126451.XJMtqz.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Register the :class:`contextvars.Context` type to | ||
:class:`collections.abc.Mapping`. |