From 3d138380c2bdc82e24742bf8f311c55da30aecfe Mon Sep 17 00:00:00 2001 From: Patrick Rauscher Date: Fri, 15 Mar 2024 13:10:16 +0100 Subject: [PATCH] Allow slices for SynchronizedArray (#11573) --- stdlib/multiprocessing/sharedctypes.pyi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stdlib/multiprocessing/sharedctypes.pyi b/stdlib/multiprocessing/sharedctypes.pyi index 4cdae5c43..4093a97e6 100644 --- a/stdlib/multiprocessing/sharedctypes.pyi +++ b/stdlib/multiprocessing/sharedctypes.pyi @@ -91,7 +91,13 @@ class Synchronized(SynchronizedBase[_SimpleCData[_T]], Generic[_T]): class SynchronizedArray(SynchronizedBase[ctypes.Array[_CT]], Generic[_CT]): def __len__(self) -> int: ... + @overload + def __getitem__(self, i: slice) -> list[_CT]: ... + @overload def __getitem__(self, i: int) -> _CT: ... + @overload + def __setitem__(self, i: slice, value: Iterable[_CT]) -> None: ... + @overload def __setitem__(self, i: int, value: _CT) -> None: ... def __getslice__(self, start: int, stop: int) -> list[_CT]: ... def __setslice__(self, start: int, stop: int, values: Iterable[_CT]) -> None: ...