From 76e6bdb5aba45ef7df873cb2565fd25bacaf811e Mon Sep 17 00:00:00 2001 From: guoci Date: Sat, 22 Nov 2025 12:59:04 -0500 Subject: [PATCH 1/4] [stdlib] update `multiprocessing.managers.BaseListProxy` --- stdlib/@tests/stubtest_allowlists/py314.txt | 1 - stdlib/multiprocessing/managers.pyi | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 0fcdcbb84d97..2043f81e9f7b 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -3,7 +3,6 @@ # ==================================================================== multiprocessing.managers.BaseListProxy.clear -multiprocessing.managers.BaseListProxy.copy multiprocessing.managers.DictProxy.__ior__ multiprocessing.managers._BaseDictProxy.__ior__ multiprocessing.managers._BaseDictProxy.__or__ diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 5efe69a97377..87a245b0fa9c 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): From e6095961ea4bbadcddc565bb4634bf2987d5273d Mon Sep 17 00:00:00 2001 From: Guo Ci Date: Sun, 23 Nov 2025 12:46:21 -0500 Subject: [PATCH 2/4] revert some changes to make CI pass --- stdlib/@tests/stubtest_allowlists/py314.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 2043f81e9f7b..0fcdcbb84d97 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -3,6 +3,7 @@ # ==================================================================== multiprocessing.managers.BaseListProxy.clear +multiprocessing.managers.BaseListProxy.copy multiprocessing.managers.DictProxy.__ior__ multiprocessing.managers._BaseDictProxy.__ior__ multiprocessing.managers._BaseDictProxy.__or__ From 3d2859458726eac9f362af493951403050a81923 Mon Sep 17 00:00:00 2001 From: Guo Ci Date: Sun, 23 Nov 2025 12:46:48 -0500 Subject: [PATCH 3/4] revert some changes to make CI pass --- stdlib/multiprocessing/managers.pyi | 2 -- 1 file changed, 2 deletions(-) diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 87a245b0fa9c..e175383c5284 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -192,8 +192,6 @@ 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 From 914bb3150f5e2a7541ce7872956733ba9446d33d Mon Sep 17 00:00:00 2001 From: guoci Date: Mon, 24 Nov 2025 11:01:37 -0500 Subject: [PATCH 4/4] fixes for `multiprocessing.managers.BaseListProxy.copy` --- stdlib/@tests/stubtest_allowlists/py314.txt | 1 + stdlib/multiprocessing/managers.pyi | 2 ++ 2 files changed, 3 insertions(+) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 0fcdcbb84d97..c991b6b64524 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 e175383c5284..87a245b0fa9c 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