mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Add multiprocessing.dummy pyi files (#2059)
This commit is contained in:
committed by
Jelle Zijlstra
parent
8e62a79970
commit
2935017157
53
stdlib/2/multiprocessing/dummy/__init__.pyi
Normal file
53
stdlib/2/multiprocessing/dummy/__init__.pyi
Normal file
@@ -0,0 +1,53 @@
|
||||
from typing import Any, Optional, List, Type
|
||||
|
||||
import threading
|
||||
import sys
|
||||
import weakref
|
||||
import array
|
||||
import itertools
|
||||
|
||||
from multiprocessing import TimeoutError, cpu_count
|
||||
from multiprocessing.dummy.connection import Pipe
|
||||
from threading import Lock, RLock, Semaphore, BoundedSemaphore
|
||||
from threading import Event
|
||||
from Queue import Queue
|
||||
|
||||
__all__ = ... # type: List[str]
|
||||
|
||||
|
||||
class DummyProcess(threading.Thread):
|
||||
_children = ... # type: weakref.WeakKeyDictionary
|
||||
_parent = ... # type: threading.Thread
|
||||
_pid = ... # type: None
|
||||
_start_called = ... # type: bool
|
||||
def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ...
|
||||
@property
|
||||
def exitcode(self) -> Optional[int]: ...
|
||||
|
||||
|
||||
Process = DummyProcess
|
||||
|
||||
# This should be threading._Condition but threading.pyi exports it as Condition
|
||||
class Condition(threading.Condition):
|
||||
notify_all = ... # type: Any
|
||||
|
||||
class Namespace(object):
|
||||
def __init__(self, **kwds) -> None: ...
|
||||
|
||||
class Value(object):
|
||||
_typecode = ... # type: Any
|
||||
_value = ... # type: Any
|
||||
value = ... # type: Any
|
||||
def __init__(self, typecode, value, lock=...) -> None: ...
|
||||
def _get(self) -> Any: ...
|
||||
def _set(self, value) -> None: ...
|
||||
|
||||
JoinableQueue = Queue
|
||||
|
||||
def Array(typecode, sequence, lock=...) -> array.array: ...
|
||||
def Manager() -> Any: ...
|
||||
def Pool(processes=..., initializer=..., initargs=...) -> Any: ...
|
||||
def active_children() -> List: ...
|
||||
def current_process() -> threading.Thread: ...
|
||||
def freeze_support() -> None: ...
|
||||
def shutdown() -> None: ...
|
||||
27
stdlib/2/multiprocessing/dummy/connection.pyi
Normal file
27
stdlib/2/multiprocessing/dummy/connection.pyi
Normal file
@@ -0,0 +1,27 @@
|
||||
from Queue import Queue
|
||||
from typing import Any, List, Optional, Tuple, Type
|
||||
|
||||
__all__ = ... # type: List[str]
|
||||
families = ... # type: List[None]
|
||||
|
||||
class Connection(object):
|
||||
_in = ... # type: Any
|
||||
_out = ... # type: Any
|
||||
recv = ... # type: Any
|
||||
recv_bytes = ... # type: Any
|
||||
send = ... # type: Any
|
||||
send_bytes = ... # type: Any
|
||||
def __init__(self, _in, _out) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def poll(self, timeout=...) -> Any: ...
|
||||
|
||||
class Listener(object):
|
||||
_backlog_queue = ... # type: Optional[Queue]
|
||||
address = ... # type: Any
|
||||
def __init__(self, address=..., family=..., backlog=...) -> None: ...
|
||||
def accept(self) -> Connection: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
|
||||
def Client(address) -> Connection: ...
|
||||
def Pipe(duplex=...) -> Tuple[Connection, Connection]: ...
|
||||
44
stdlib/3/multiprocessing/dummy/__init__.pyi
Normal file
44
stdlib/3/multiprocessing/dummy/__init__.pyi
Normal file
@@ -0,0 +1,44 @@
|
||||
from typing import Any, Optional, List, Type
|
||||
|
||||
import array
|
||||
import sys
|
||||
import threading
|
||||
import weakref
|
||||
|
||||
from .connection import Pipe
|
||||
from threading import Lock, RLock, Semaphore, BoundedSemaphore
|
||||
from threading import Event, Condition, Barrier
|
||||
from queue import Queue
|
||||
|
||||
JoinableQueue = Queue
|
||||
|
||||
__all__ = ... # type: List[str]
|
||||
|
||||
|
||||
class DummyProcess(threading.Thread):
|
||||
_children = ... # type: weakref.WeakKeyDictionary
|
||||
_parent = ... # type: threading.Thread
|
||||
_pid = ... # type: None
|
||||
_start_called = ... # type: int
|
||||
exitcode = ... # type: Optional[int]
|
||||
def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ...
|
||||
|
||||
Process = DummyProcess
|
||||
|
||||
class Namespace(object):
|
||||
def __init__(self, **kwds) -> None: ...
|
||||
|
||||
class Value(object):
|
||||
_typecode = ... # type: Any
|
||||
_value = ... # type: Any
|
||||
value = ... # type: Any
|
||||
def __init__(self, typecode, value, lock=...) -> None: ...
|
||||
|
||||
|
||||
def Array(typecode, sequence, lock=...) -> array.array: ...
|
||||
def Manager() -> Any: ...
|
||||
def Pool(processes=..., initializer=..., initargs=...) -> Any: ...
|
||||
def active_children() -> List: ...
|
||||
def current_process() -> threading.Thread: ...
|
||||
def freeze_support() -> None: ...
|
||||
def shutdown() -> None: ...
|
||||
36
stdlib/3/multiprocessing/dummy/connection.pyi
Normal file
36
stdlib/3/multiprocessing/dummy/connection.pyi
Normal file
@@ -0,0 +1,36 @@
|
||||
from typing import Any, List, Optional, Tuple, Type, TypeVar
|
||||
|
||||
from queue import Queue
|
||||
|
||||
__all__ = ... # type: List[str]
|
||||
families = ... # type: List[None]
|
||||
|
||||
_TConnection = TypeVar('_TConnection', bound=Connection)
|
||||
_TListener = TypeVar('_TListener', bound=Listener)
|
||||
|
||||
class Connection(object):
|
||||
_in = ... # type: Any
|
||||
_out = ... # type: Any
|
||||
recv = ... # type: Any
|
||||
recv_bytes = ... # type: Any
|
||||
send = ... # type: Any
|
||||
send_bytes = ... # type: Any
|
||||
def __enter__(self: _TConnection) -> _TConnection: ...
|
||||
def __exit__(self, exc_type, exc_value, exc_tb) -> None: ...
|
||||
def __init__(self, _in, _out) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def poll(self, timeout: float=...) -> bool: ...
|
||||
|
||||
class Listener(object):
|
||||
_backlog_queue = ... # type: Optional[Queue]
|
||||
@property
|
||||
def address(self) -> Optional[Queue]: ...
|
||||
def __enter__(self: _TListener) -> _TListener: ...
|
||||
def __exit__(self, exc_type, exc_value, exc_tb) -> None: ...
|
||||
def __init__(self, address=..., family=..., backlog=...) -> None: ...
|
||||
def accept(self) -> Connection: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
|
||||
def Client(address) -> Connection: ...
|
||||
def Pipe(duplex: bool=...) -> Tuple[Connection, Connection]: ...
|
||||
Reference in New Issue
Block a user