From bc805f6badac7e8fa3ae5bee6c55ae737d7d47b0 Mon Sep 17 00:00:00 2001 From: Guo Ci Date: Mon, 24 Nov 2025 11:30:50 -0500 Subject: [PATCH] [multiprocessing] Update `BaseListProxy`, `multiprocessing.managers.list` (#15070) --- stdlib/@tests/stubtest_allowlists/py314.txt | 1 + stdlib/multiprocessing/managers.pyi | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 76d040873..8dbc81dff 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -3,6 +3,7 @@ # ==================================================================== multiprocessing.managers.BaseListProxy.clear +# inspect.signature gives the wrong signature multiprocessing.managers.BaseListProxy.copy multiprocessing.managers.DictProxy.__ior__ multiprocessing.managers._BaseDictProxy.__ior__ diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 5efe69a97..87a245b0f 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -192,6 +192,8 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]): def count(self, value: _T, /) -> int: ... def insert(self, index: SupportsIndex, object: _T, /) -> None: ... def remove(self, value: _T, /) -> None: ... + if sys.version_info >= (3, 14): + def copy(self) -> list[_T]: ... # Use BaseListProxy[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] # to work around invariance @overload @@ -326,8 +328,9 @@ class SyncManager(BaseManager): def dict(self, iterable: Iterable[list[str]], /) -> DictProxy[str, str]: ... @overload def dict(self, iterable: Iterable[list[bytes]], /) -> DictProxy[bytes, bytes]: ... + # Overloads are copied from builtins.list.__init__ @overload - def list(self, sequence: Sequence[_T], /) -> ListProxy[_T]: ... + def list(self, iterable: Iterable[_T], /) -> ListProxy[_T]: ... @overload def list(self) -> ListProxy[Any]: ... if sys.version_info >= (3, 14):