mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
[3.13] gh-126417: Register multiprocessing proxy types to an appropriate collections.abc class (#126419) (#126435)
Co-authored-by: Stephen Morton <github@tungol.org>
This commit is contained in:
parent
cba17e4d92
commit
c1e708ab07
4 changed files with 16 additions and 0 deletions
|
@ -16,6 +16,7 @@ import errno
|
|||
import functools
|
||||
import signal
|
||||
import array
|
||||
import collections.abc
|
||||
import socket
|
||||
import random
|
||||
import logging
|
||||
|
@ -2331,6 +2332,10 @@ class _TestContainers(BaseTestCase):
|
|||
a.append('hello')
|
||||
self.assertEqual(f[0][:], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'hello'])
|
||||
|
||||
def test_list_isinstance(self):
|
||||
a = self.list()
|
||||
self.assertIsInstance(a, collections.abc.MutableSequence)
|
||||
|
||||
def test_list_iter(self):
|
||||
a = self.list(list(range(10)))
|
||||
it = iter(a)
|
||||
|
@ -2371,6 +2376,10 @@ class _TestContainers(BaseTestCase):
|
|||
self.assertEqual(sorted(d.values()), [chr(i) for i in indices])
|
||||
self.assertEqual(sorted(d.items()), [(i, chr(i)) for i in indices])
|
||||
|
||||
def test_dict_isinstance(self):
|
||||
a = self.dict()
|
||||
self.assertIsInstance(a, collections.abc.MutableMapping)
|
||||
|
||||
def test_dict_iter(self):
|
||||
d = self.dict()
|
||||
indices = list(range(65, 70))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue