Skip to content

Commit

Permalink
multiprocessing: make some overloads more precise
Browse files Browse the repository at this point in the history
See discussion here: python#4266 (comment)
  • Loading branch information
hauntsaninja committed Jul 19, 2022
1 parent 936314b commit 492f459
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions stdlib/multiprocessing/context.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions stdlib/multiprocessing/sharedctypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -43,15 +43,15 @@ 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
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
Expand Down

0 comments on commit 492f459

Please sign in to comment.