Add more multiprocessing function stubs (#1435)

Fixes #1422
This commit is contained in:
khyox
2017-07-01 07:25:05 +02:00
committed by Jelle Zijlstra
parent 218ce96871
commit 61154a9ad2

View File

@@ -1,11 +1,13 @@
# Stubs for multiprocessing
from typing import Any, Callable, Iterable, Mapping, Optional, Dict, List
from typing import Any, Callable, Iterable, Mapping, Optional, Dict, List, Union
from logging import Logger
from multiprocessing.context import BaseContext
from multiprocessing.managers import SyncManager
from multiprocessing.pool import AsyncResult
from multiprocessing.process import current_process as current_process
import sys
class Lock():
def acquire(self, block: bool = ..., timeout: int = ...) -> None: ...
@@ -101,6 +103,18 @@ class Value():
def __init__(self, typecode_or_type: str, *args: Any, lock: bool = ...) -> None: ...
# ----- multiprocessing function stubs -----
def active_children() -> List[Process]: ...
def allow_connection_pickling() -> None: ...
def cpu_count() -> int: ...
def freeze_support() -> None: ...
def get_logger() -> Logger: ...
def log_to_stderr(level: Optional[Union[str, int]] = ...) -> Logger: ...
def Manager() -> SyncManager: ...
def set_forkserver_preload(module_names: List[str]) -> None: ...
if sys.platform == 'win32' or sys.version_info >= (3, 4):
def set_executable(executable: str) -> None: ...
if sys.version_info >= (3, 4):
def get_all_start_methods() -> List[str]: ...
def get_context(method: Optional[str] = ...) -> BaseContext: ...
def get_start_method(allow_none: Optional[bool]) -> Optional[str]: ...
def set_start_method(method: str, force: Optional[bool] = ...) -> None: ...