mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Add multiprocessing.Array (#3272)
This commit is contained in:
committed by
Sebastian Rittau
parent
c0371df172
commit
d4727c39f1
@@ -2,7 +2,7 @@
|
||||
|
||||
from typing import (
|
||||
Any, Callable, ContextManager, Iterable, Mapping, Optional, Dict, List,
|
||||
Union, Sequence, Tuple, Type
|
||||
Union, Sequence, Tuple, Type, overload
|
||||
)
|
||||
|
||||
from ctypes import _CData
|
||||
@@ -67,10 +67,30 @@ class Process():
|
||||
def is_alive(self) -> bool: ...
|
||||
def join(self, timeout: Optional[float] = ...) -> None: ...
|
||||
|
||||
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: ...
|
||||
|
||||
# ----- multiprocessing function stubs -----
|
||||
def active_children() -> List[Process]: ...
|
||||
|
||||
Reference in New Issue
Block a user