diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 13024e94aaf3..66c7de1b3fa7 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -430,7 +430,6 @@ inspect.Signature.empty # set as private marker _empty # These multiprocessing proxy methods have *args, **kwargs signatures at runtime, # But have more precise (accurate) signatures in the stub -multiprocessing.managers.BaseListProxy.__imul__ multiprocessing.managers.BaseListProxy.__len__ multiprocessing.managers.BaseListProxy.__reversed__ multiprocessing.managers.BaseListProxy.reverse diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index c5a1134377a1..3ab7d87f8d6f 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -2,7 +2,7 @@ import queue import sys import threading from _typeshed import Incomplete, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT -from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, MutableSequence, Sequence +from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence from types import TracebackType from typing import Any, AnyStr, ClassVar, Generic, SupportsIndex, TypeVar, overload from typing_extensions import Self, TypeAlias @@ -86,10 +86,11 @@ class DictProxy(BaseProxy, MutableMapping[_KT, _VT]): if sys.version_info >= (3, 13): def __class_getitem__(cls, args: Any, /) -> Any: ... -class BaseListProxy(BaseProxy, MutableSequence[_T]): +class BaseListProxy(BaseProxy, Generic[_T]): __builtins__: ClassVar[dict[str, Any]] def __len__(self) -> int: ... def __add__(self, x: list[_T], /) -> list[_T]: ... + def __contains__(self, value: object, /) -> bool: ... def __delitem__(self, i: SupportsIndex | slice, /) -> None: ... @overload def __getitem__(self, i: SupportsIndex, /) -> _T: ... @@ -99,6 +100,7 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]): def __setitem__(self, i: SupportsIndex, o: _T, /) -> None: ... @overload def __setitem__(self, s: slice, o: Iterable[_T], /) -> None: ... + def __imul__(self, value: SupportsIndex, /) -> Self: ... def __mul__(self, n: SupportsIndex, /) -> list[_T]: ... def __rmul__(self, n: SupportsIndex, /) -> list[_T]: ... def __reversed__(self) -> Iterator[_T]: ... @@ -109,6 +111,7 @@ 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: ... + def reverse(self) -> None: ... # Use BaseListProxy[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] # to work around invariance @overload @@ -117,8 +120,8 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]): def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... class ListProxy(BaseListProxy[_T]): - def __iadd__(self, value: Iterable[_T], /) -> Self: ... # type: ignore[override] - def __imul__(self, value: SupportsIndex, /) -> Self: ... # type: ignore[override] + def __iadd__(self, value: Iterable[_T]) -> Self: ... # type: ignore[override] + def __imul__(self, value: SupportsIndex) -> Self: ... # type: ignore[override] if sys.version_info >= (3, 13): def __class_getitem__(cls, args: Any, /) -> Any: ...