Skip to content

Commit 9705e20

Browse files
committed
Revert "[3.13] gh-126451: Register contextvars.Context to collections.abc.Mapping (GH-126452) (#126518)"
This reverts commit 59316a6.
1 parent efd8fe4 commit 9705e20

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

Lib/contextvars.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import _collections_abc
21
from _contextvars import Context, ContextVar, Token, copy_context
32

43

54
__all__ = ('Context', 'ContextVar', 'Token', 'copy_context')
6-
7-
8-
_collections_abc.Mapping.register(Context)

Lib/test/test_context.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import collections.abc
21
import concurrent.futures
32
import contextvars
43
import functools
@@ -343,19 +342,6 @@ def ctx2_fun():
343342

344343
ctx1.run(ctx1_fun)
345344

346-
def test_context_isinstance(self):
347-
ctx = contextvars.Context()
348-
self.assertIsInstance(ctx, collections.abc.Mapping)
349-
self.assertTrue(issubclass(contextvars.Context, collections.abc.Mapping))
350-
351-
mapping_methods = (
352-
'__contains__', '__eq__', '__getitem__', '__iter__', '__len__',
353-
'__ne__', 'get', 'items', 'keys', 'values',
354-
)
355-
for name in mapping_methods:
356-
with self.subTest(name=name):
357-
self.assertTrue(callable(getattr(ctx, name)))
358-
359345
@isolated_context
360346
@threading_helper.requires_working_threading()
361347
def test_context_threads_1(self):

Misc/NEWS.d/next/Library/2024-11-05-11-28-45.gh-issue-126451.XJMtqz.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)