mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-26 13:51:30 +08:00
Allow passing lambdas as init arguments in multiprocessing (#1416)
* Use NoReturn in multiprocessing init functions * Use Any for init functions
This commit is contained in:
committed by
Matthias Kramm
parent
d5eb32d67e
commit
4a8a20f04e
@@ -49,14 +49,13 @@ class BaseContext(object):
|
||||
def JoinableQueue(self, maxsize: int = ...) -> Any: ...
|
||||
# TODO: change return to SimpleQueue once a stub exists in multiprocessing.queues
|
||||
def SimpleQueue(self) -> Any: ...
|
||||
# TODO: change return to Pool once a stub exists in multiprocessing.pool
|
||||
def Pool(
|
||||
self,
|
||||
processes: Optional[int] = ...,
|
||||
initializer: Optional[Callable[..., Any]] = ...,
|
||||
initargs: Tuple = ...,
|
||||
maxtasksperchild: Optional[int] = ...
|
||||
) -> Any: ...
|
||||
) -> multiprocessing.Pool: ...
|
||||
# TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out
|
||||
# how to handle the ctype
|
||||
# TODO: change return to RawValue once a stub exists in multiprocessing.sharedctypes
|
||||
|
||||
@@ -19,7 +19,7 @@ _Namespace = Namespace
|
||||
class BaseManager:
|
||||
def register(self, typeid: str, callable: Any = ...) -> None: ...
|
||||
def shutdown(self) -> None: ...
|
||||
def start(self, initializer: Optional[Callable[..., None]] = ...,
|
||||
def start(self, initializer: Optional[Callable[..., Any]] = ...,
|
||||
initargs: Iterable[Any] = ...) -> None: ...
|
||||
def __enter__(self) -> 'BaseManager': ...
|
||||
def __exit__(self, exc_type, exc_value, tb) -> None: ...
|
||||
|
||||
@@ -12,7 +12,7 @@ class AsyncResult():
|
||||
|
||||
class ThreadPool():
|
||||
def __init__(self, processes: Optional[int] = None,
|
||||
initializer: Optional[Callable[..., None]] = None,
|
||||
initializer: Optional[Callable[..., Any]] = None,
|
||||
initargs: Iterable[Any] = ...) -> None: ...
|
||||
def apply(self,
|
||||
func: Callable[..., Any],
|
||||
|
||||
Reference in New Issue
Block a user