From 492f459ac556cd9b4d6f37040b3e11469d4e41c2 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Mon, 18 Jul 2022 21:18:01 -0700 Subject: [PATCH] multiprocessing: make some overloads more precise See discussion here: https://github.com/python/typeshed/issues/4266#issuecomment-1187867029 --- stdlib/multiprocessing/context.pyi | 8 ++++---- stdlib/multiprocessing/sharedctypes.pyi | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stdlib/multiprocessing/context.pyi b/stdlib/multiprocessing/context.pyi index ed52325915c4..7215955da535 100644 --- a/stdlib/multiprocessing/context.pyi +++ b/stdlib/multiprocessing/context.pyi @@ -76,20 +76,20 @@ class BaseContext: @overload def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[False]) -> _CT: ... @overload - def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike) -> SynchronizedBase[_CT]: ... + def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = ...) -> SynchronizedBase[_CT]: ... @overload - def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike) -> SynchronizedBase[Any]: ... + def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = ...) -> SynchronizedBase[Any]: ... @overload def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = ...) -> Any: ... @overload def Array(self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False]) -> _CT: ... @overload def Array( - self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike + self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = ... ) -> SynchronizedArray[_CT]: ... @overload def Array( - self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike + self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = ... ) -> SynchronizedArray[Any]: ... @overload def Array( diff --git a/stdlib/multiprocessing/sharedctypes.pyi b/stdlib/multiprocessing/sharedctypes.pyi index 8b1b1c1cee6e..e988cda322f4 100644 --- a/stdlib/multiprocessing/sharedctypes.pyi +++ b/stdlib/multiprocessing/sharedctypes.pyi @@ -24,11 +24,11 @@ def RawArray(typecode_or_type: str, size_or_initializer: int | Sequence[Any]) -> def Value(typecode_or_type: type[_CT], *args: Any, lock: Literal[False], ctx: BaseContext | None = ...) -> _CT: ... @overload def Value( - typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike, ctx: BaseContext | None = ... + typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ... ) -> SynchronizedBase[_CT]: ... @overload def Value( - typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike, ctx: BaseContext | None = ... + typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ... ) -> SynchronizedBase[Any]: ... @overload def Value( @@ -43,7 +43,7 @@ def Array( typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, - lock: Literal[True] | _LockLike, + lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ..., ) -> SynchronizedArray[_CT]: ... @overload @@ -51,7 +51,7 @@ def Array( typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, - lock: Literal[True] | _LockLike, + lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ..., ) -> SynchronizedArray[Any]: ... @overload