Use variable annotations everywhere (#2909)

This commit is contained in:
Michael Lee
2019-04-13 01:40:52 -07:00
committed by Sebastian Rittau
parent b3c76aab49
commit efb67946f8
458 changed files with 9135 additions and 9135 deletions

View File

@@ -21,10 +21,10 @@ class TimeoutError(ProcessError): ...
class AuthenticationError(ProcessError): ...
class BaseContext(object):
ProcessError = ... # type: Type[Exception]
BufferTooShort = ... # type: Type[Exception]
TimeoutError = ... # type: Type[Exception]
AuthenticationError = ... # type: Type[Exception]
ProcessError: Type[Exception]
BufferTooShort: Type[Exception]
TimeoutError: Type[Exception]
AuthenticationError: Type[Exception]
# N.B. The methods below are applied at runtime to generate
# multiprocessing.*, so the signatures should be identical (modulo self).
@@ -121,7 +121,7 @@ class Process(object):
def _Popen(process_obj: Any) -> DefaultContext: ...
class DefaultContext(object):
Process = ... # type: Type[multiprocessing.Process]
Process: Type[multiprocessing.Process]
def __init__(self, context: BaseContext) -> None: ...
def get_context(self, method: Optional[str] = ...) -> BaseContext: ...
@@ -150,15 +150,15 @@ if sys.platform != 'win32':
class ForkContext(BaseContext):
_name: str
Process = ... # type: Type[ForkProcess]
Process: Type[ForkProcess]
class SpawnContext(BaseContext):
_name: str
Process = ... # type: Type[SpawnProcess]
Process: Type[SpawnProcess]
class ForkServerContext(BaseContext):
_name: str
Process = ... # type: Type[ForkServerProcess]
Process: Type[ForkServerProcess]
else:
# TODO: type should be BaseProcess once a stub in multiprocessing.process exists
class SpawnProcess(Any): # type: ignore
@@ -169,7 +169,7 @@ else:
class SpawnContext(BaseContext):
_name: str
Process = ... # type: Type[SpawnProcess]
Process: Type[SpawnProcess]
def _force_start_method(method: str) -> None: ...
# TODO: type should be BaseProcess once a stub in multiprocessing.process exists

View File

@@ -14,11 +14,11 @@ JoinableQueue = Queue
class DummyProcess(threading.Thread):
_children = ... # type: weakref.WeakKeyDictionary
_parent = ... # type: threading.Thread
_pid = ... # type: None
_start_called = ... # type: int
exitcode = ... # type: Optional[int]
_children: weakref.WeakKeyDictionary
_parent: threading.Thread
_pid: None
_start_called: int
exitcode: Optional[int]
def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ...
Process = DummyProcess
@@ -27,9 +27,9 @@ class Namespace(object):
def __init__(self, **kwds) -> None: ...
class Value(object):
_typecode = ... # type: Any
_value = ... # type: Any
value = ... # type: Any
_typecode: Any
_value: Any
value: Any
def __init__(self, typecode, value, lock=...) -> None: ...

View File

@@ -2,18 +2,18 @@ from typing import Any, List, Optional, Tuple, Type, TypeVar
from queue import Queue
families = ... # type: List[None]
families: 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
_in: Any
_out: Any
recv: Any
recv_bytes: Any
send: Any
send_bytes: Any
def __enter__(self: _TConnection) -> _TConnection: ...
def __exit__(self, exc_type, exc_value, exc_tb) -> None: ...
def __init__(self, _in, _out) -> None: ...
@@ -21,7 +21,7 @@ class Connection(object):
def poll(self, timeout: float = ...) -> bool: ...
class Listener(object):
_backlog_queue = ... # type: Optional[Queue]
_backlog_queue: Optional[Queue]
@property
def address(self) -> Optional[Queue]: ...
def __enter__(self: _TListener) -> _TListener: ...