mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Re-organize directory structure (#4971)
See discussion in #2491 Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
This commit is contained in:
50
stdlib/@python2/multiprocessing/__init__.pyi
Normal file
50
stdlib/@python2/multiprocessing/__init__.pyi
Normal file
@@ -0,0 +1,50 @@
|
||||
from multiprocessing import pool
|
||||
from multiprocessing.process import Process as Process, active_children as active_children, current_process as current_process
|
||||
from multiprocessing.util import SUBDEBUG as SUBDEBUG, SUBWARNING as SUBWARNING
|
||||
from Queue import Queue as _BaseQueue
|
||||
from typing import Any, Callable, Iterable, Optional, TypeVar
|
||||
|
||||
class ProcessError(Exception): ...
|
||||
class BufferTooShort(ProcessError): ...
|
||||
class TimeoutError(ProcessError): ...
|
||||
class AuthenticationError(ProcessError): ...
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class Queue(_BaseQueue[_T]):
|
||||
def __init__(self, maxsize: int = ...) -> None: ...
|
||||
def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ...
|
||||
def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ...
|
||||
def qsize(self) -> int: ...
|
||||
def empty(self) -> bool: ...
|
||||
def full(self) -> bool: ...
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
def get_nowait(self) -> _T: ...
|
||||
def close(self) -> None: ...
|
||||
def join_thread(self) -> None: ...
|
||||
def cancel_join_thread(self) -> None: ...
|
||||
|
||||
def Manager(): ...
|
||||
def Pipe(duplex: bool = ...): ...
|
||||
def cpu_count() -> int: ...
|
||||
def freeze_support(): ...
|
||||
def get_logger(): ...
|
||||
def log_to_stderr(level: Optional[Any] = ...): ...
|
||||
def allow_connection_pickling(): ...
|
||||
def Lock(): ...
|
||||
def RLock(): ...
|
||||
def Condition(lock: Optional[Any] = ...): ...
|
||||
def Semaphore(value: int = ...): ...
|
||||
def BoundedSemaphore(value: int = ...): ...
|
||||
def Event(): ...
|
||||
def JoinableQueue(maxsize: int = ...): ...
|
||||
def RawValue(typecode_or_type, *args): ...
|
||||
def RawArray(typecode_or_type, size_or_initializer): ...
|
||||
def Value(typecode_or_type, *args, **kwds): ...
|
||||
def Array(typecode_or_type, size_or_initializer, **kwds): ...
|
||||
def Pool(
|
||||
processes: Optional[int] = ...,
|
||||
initializer: Optional[Callable[..., Any]] = ...,
|
||||
initargs: Iterable[Any] = ...,
|
||||
maxtasksperchild: Optional[int] = ...,
|
||||
) -> pool.Pool: ...
|
||||
46
stdlib/@python2/multiprocessing/dummy/__init__.pyi
Normal file
46
stdlib/@python2/multiprocessing/dummy/__init__.pyi
Normal file
@@ -0,0 +1,46 @@
|
||||
import array
|
||||
import itertools
|
||||
import sys
|
||||
import threading
|
||||
import weakref
|
||||
from multiprocessing import TimeoutError, cpu_count
|
||||
from multiprocessing.dummy.connection import Pipe
|
||||
from Queue import Queue
|
||||
from threading import BoundedSemaphore, Event, Lock, RLock, Semaphore
|
||||
from typing import Any, List, Optional, Type
|
||||
|
||||
class DummyProcess(threading.Thread):
|
||||
_children: weakref.WeakKeyDictionary[Any, Any]
|
||||
_parent: threading.Thread
|
||||
_pid: None
|
||||
_start_called: 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: Any
|
||||
|
||||
class Namespace(object):
|
||||
def __init__(self, **kwds) -> None: ...
|
||||
|
||||
class Value(object):
|
||||
_typecode: Any
|
||||
_value: Any
|
||||
value: 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[Any]: ...
|
||||
def Manager() -> Any: ...
|
||||
def Pool(processes=..., initializer=..., initargs=...) -> Any: ...
|
||||
def active_children() -> List[Any]: ...
|
||||
def current_process() -> threading.Thread: ...
|
||||
def freeze_support() -> None: ...
|
||||
def shutdown() -> None: ...
|
||||
25
stdlib/@python2/multiprocessing/dummy/connection.pyi
Normal file
25
stdlib/@python2/multiprocessing/dummy/connection.pyi
Normal file
@@ -0,0 +1,25 @@
|
||||
from Queue import Queue
|
||||
from typing import Any, List, Optional, Tuple, Type
|
||||
|
||||
families: List[None]
|
||||
|
||||
class Connection(object):
|
||||
_in: Any
|
||||
_out: Any
|
||||
recv: Any
|
||||
recv_bytes: Any
|
||||
send: Any
|
||||
send_bytes: Any
|
||||
def __init__(self, _in, _out) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def poll(self, timeout=...) -> Any: ...
|
||||
|
||||
class Listener(object):
|
||||
_backlog_queue: Optional[Queue[Any]]
|
||||
address: 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]: ...
|
||||
52
stdlib/@python2/multiprocessing/pool.pyi
Normal file
52
stdlib/@python2/multiprocessing/pool.pyi
Normal file
@@ -0,0 +1,52 @@
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TypeVar
|
||||
|
||||
_T = TypeVar("_T", bound=Pool)
|
||||
|
||||
class AsyncResult:
|
||||
def get(self, timeout: Optional[float] = ...) -> Any: ...
|
||||
def wait(self, timeout: Optional[float] = ...) -> None: ...
|
||||
def ready(self) -> bool: ...
|
||||
def successful(self) -> bool: ...
|
||||
|
||||
class IMapIterator(Iterator[Any]):
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
def next(self, timeout: Optional[float] = ...) -> Any: ...
|
||||
|
||||
class IMapUnorderedIterator(IMapIterator): ...
|
||||
|
||||
class Pool(object):
|
||||
def __init__(
|
||||
self,
|
||||
processes: Optional[int] = ...,
|
||||
initializer: Optional[Callable[..., None]] = ...,
|
||||
initargs: Iterable[Any] = ...,
|
||||
maxtasksperchild: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
def apply(self, func: Callable[..., Any], args: Iterable[Any] = ..., kwds: Dict[str, Any] = ...) -> Any: ...
|
||||
def apply_async(
|
||||
self,
|
||||
func: Callable[..., Any],
|
||||
args: Iterable[Any] = ...,
|
||||
kwds: Dict[str, Any] = ...,
|
||||
callback: Optional[Callable[..., None]] = ...,
|
||||
) -> AsyncResult: ...
|
||||
def map(self, func: Callable[..., Any], iterable: Iterable[Any] = ..., chunksize: Optional[int] = ...) -> List[Any]: ...
|
||||
def map_async(
|
||||
self,
|
||||
func: Callable[..., Any],
|
||||
iterable: Iterable[Any] = ...,
|
||||
chunksize: Optional[int] = ...,
|
||||
callback: Optional[Callable[..., None]] = ...,
|
||||
) -> AsyncResult: ...
|
||||
def imap(self, func: Callable[..., Any], iterable: Iterable[Any] = ..., chunksize: Optional[int] = ...) -> IMapIterator: ...
|
||||
def imap_unordered(
|
||||
self, func: Callable[..., Any], iterable: Iterable[Any] = ..., chunksize: Optional[int] = ...
|
||||
) -> IMapIterator: ...
|
||||
def close(self) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
def join(self) -> None: ...
|
||||
|
||||
class ThreadPool(Pool):
|
||||
def __init__(
|
||||
self, processes: Optional[int] = ..., initializer: Optional[Callable[..., Any]] = ..., initargs: Iterable[Any] = ...
|
||||
) -> None: ...
|
||||
37
stdlib/@python2/multiprocessing/process.pyi
Normal file
37
stdlib/@python2/multiprocessing/process.pyi
Normal file
@@ -0,0 +1,37 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
def current_process(): ...
|
||||
def active_children(): ...
|
||||
|
||||
class Process:
|
||||
def __init__(
|
||||
self, group: Optional[Any] = ..., target: Optional[Any] = ..., name: Optional[Any] = ..., args=..., kwargs=...
|
||||
): ...
|
||||
def run(self): ...
|
||||
def start(self): ...
|
||||
def terminate(self): ...
|
||||
def join(self, timeout: Optional[Any] = ...): ...
|
||||
def is_alive(self): ...
|
||||
@property
|
||||
def name(self): ...
|
||||
@name.setter
|
||||
def name(self, name): ...
|
||||
@property
|
||||
def daemon(self): ...
|
||||
@daemon.setter
|
||||
def daemon(self, daemonic): ...
|
||||
@property
|
||||
def authkey(self): ...
|
||||
@authkey.setter
|
||||
def authkey(self, authkey): ...
|
||||
@property
|
||||
def exitcode(self): ...
|
||||
@property
|
||||
def ident(self): ...
|
||||
pid: Any
|
||||
|
||||
class AuthenticationString(bytes):
|
||||
def __reduce__(self): ...
|
||||
|
||||
class _MainProcess(Process):
|
||||
def __init__(self): ...
|
||||
29
stdlib/@python2/multiprocessing/util.pyi
Normal file
29
stdlib/@python2/multiprocessing/util.pyi
Normal file
@@ -0,0 +1,29 @@
|
||||
import threading
|
||||
from typing import Any, Optional
|
||||
|
||||
SUBDEBUG: Any
|
||||
SUBWARNING: Any
|
||||
|
||||
def sub_debug(msg, *args): ...
|
||||
def debug(msg, *args): ...
|
||||
def info(msg, *args): ...
|
||||
def sub_warning(msg, *args): ...
|
||||
def get_logger(): ...
|
||||
def log_to_stderr(level: Optional[Any] = ...): ...
|
||||
def get_temp_dir(): ...
|
||||
def register_after_fork(obj, func): ...
|
||||
|
||||
class Finalize:
|
||||
def __init__(self, obj, callback, args=..., kwargs: Optional[Any] = ..., exitpriority: Optional[Any] = ...): ...
|
||||
def __call__(self, wr: Optional[Any] = ...): ...
|
||||
def cancel(self): ...
|
||||
def still_active(self): ...
|
||||
|
||||
def is_exiting(): ...
|
||||
|
||||
class ForkAwareThreadLock:
|
||||
def __init__(self): ...
|
||||
|
||||
class ForkAwareLocal(threading.local):
|
||||
def __init__(self): ...
|
||||
def __reduce__(self): ...
|
||||
Reference in New Issue
Block a user