forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multiprocessing: add sharedctypes, fix some stubtest cases (python#4282)
- Loading branch information
Showing
3 changed files
with
60 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from ctypes import _CData | ||
from typing import Any, List, Optional, Sequence, Type, Union, overload | ||
|
||
from multiprocessing.synchronize import _LockLike | ||
from multiprocessing.context import BaseContext | ||
|
||
class _Array: | ||
value: Any = ... | ||
|
||
def __init__(self, typecode_or_type: Union[str, Type[_CData]], size_or_initializer: Union[int, Sequence[Any]], *, lock: Union[bool, _LockLike] = ...) -> None: ... | ||
def acquire(self) -> bool: ... | ||
def release(self) -> bool: ... | ||
def get_lock(self) -> _LockLike: ... | ||
def get_obj(self) -> Any: ... | ||
|
||
@overload | ||
def __getitem__(self, key: int) -> Any: ... | ||
@overload | ||
def __getitem__(self, key: slice) -> List[Any]: ... | ||
def __getslice__(self, start: int, stop: int) -> Any: ... | ||
def __setitem__(self, key: int, value: Any) -> None: ... | ||
|
||
class _Value(): | ||
value: Any = ... | ||
def __init__(self, typecode_or_type: Union[str, Type[_CData]], *args: Any, lock: Union[bool, _LockLike] = ...) -> None: ... | ||
def get_lock(self) -> _LockLike: ... | ||
def get_obj(self) -> Any: ... | ||
def acquire(self) -> bool: ... | ||
def release(self) -> bool: ... | ||
|
||
def Array( | ||
typecode_or_type: Union[str, Type[_CData]], | ||
size_or_initializer: Union[int, Sequence[Any]], | ||
*, | ||
lock: Union[bool, _LockLike] = ..., | ||
ctx: Optional[BaseContext] = ...) -> _Array: ... | ||
|
||
def Value( | ||
typecode_or_type: Union[str, Type[_CData]], | ||
*args: Any, | ||
lock: Union[bool, _LockLike] = ..., | ||
ctx: Optional[BaseContext] = ...) -> _Value: ... |