mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
gh-126417: Register multiprocessing proxy types to an appropriate collections.abc class (#126419)
This commit is contained in:
parent
1371295e67
commit
78842e4a98
4 changed files with 18 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ import sys
|
|||
import threading
|
||||
import signal
|
||||
import array
|
||||
import collections.abc
|
||||
import queue
|
||||
import time
|
||||
import types
|
||||
|
|
@ -1167,8 +1168,9 @@ class ListProxy(BaseListProxy):
|
|||
|
||||
__class_getitem__ = classmethod(types.GenericAlias)
|
||||
|
||||
collections.abc.MutableSequence.register(BaseListProxy)
|
||||
|
||||
_BaseDictProxy = MakeProxyType('DictProxy', (
|
||||
_BaseDictProxy = MakeProxyType('_BaseDictProxy', (
|
||||
'__contains__', '__delitem__', '__getitem__', '__ior__', '__iter__',
|
||||
'__len__', '__or__', '__reversed__', '__ror__',
|
||||
'__setitem__', 'clear', 'copy', 'fromkeys', 'get', 'items',
|
||||
|
|
@ -1184,6 +1186,8 @@ class DictProxy(_BaseDictProxy):
|
|||
|
||||
__class_getitem__ = classmethod(types.GenericAlias)
|
||||
|
||||
collections.abc.MutableMapping.register(_BaseDictProxy)
|
||||
|
||||
ArrayProxy = MakeProxyType('ArrayProxy', (
|
||||
'__len__', '__getitem__', '__setitem__'
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue