mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Use variable annotations everywhere (#2909)
This commit is contained in:
committed by
Sebastian Rittau
parent
b3c76aab49
commit
efb67946f8
@@ -114,10 +114,10 @@ if sys.version_info >= (3, 7):
|
||||
# TODO: It should be possible to instantiate these classes, but mypy
|
||||
# currently disallows this.
|
||||
# See https://github.com/python/mypy/issues/1843
|
||||
SelectorEventLoop = ... # type: Type[AbstractEventLoop]
|
||||
SelectorEventLoop: Type[AbstractEventLoop]
|
||||
if sys.platform == 'win32':
|
||||
ProactorEventLoop = ... # type: Type[AbstractEventLoop]
|
||||
DefaultEventLoopPolicy = ... # type: Type[AbstractEventLoopPolicy]
|
||||
ProactorEventLoop: Type[AbstractEventLoop]
|
||||
DefaultEventLoopPolicy: Type[AbstractEventLoopPolicy]
|
||||
|
||||
# TODO: AbstractChildWatcher (UNIX only)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ _TransProtPair = Tuple[BaseTransport, BaseProtocol]
|
||||
|
||||
class Handle:
|
||||
_cancelled = False
|
||||
_args = ... # type: List[Any]
|
||||
_args: List[Any]
|
||||
def __init__(self, callback: Callable[..., Any], args: List[Any], loop: AbstractEventLoop) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def cancel(self) -> None: ...
|
||||
|
||||
@@ -16,8 +16,8 @@ _S = TypeVar('_S', bound=Future)
|
||||
class InvalidStateError(Error): ...
|
||||
|
||||
class _TracebackLogger:
|
||||
exc = ... # type: BaseException
|
||||
tb = ... # type: List[str]
|
||||
exc: BaseException
|
||||
tb: List[str]
|
||||
def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ...
|
||||
def activate(self) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
@@ -27,11 +27,11 @@ if sys.version_info >= (3, 5):
|
||||
def isfuture(obj: object) -> bool: ...
|
||||
|
||||
class Future(Awaitable[_T], Iterable[_T]):
|
||||
_state = ... # type: str
|
||||
_exception = ... # type: BaseException
|
||||
_state: str
|
||||
_exception: BaseException
|
||||
_blocking = False
|
||||
_log_traceback = False
|
||||
_tb_logger = ... # type: Type[_TracebackLogger]
|
||||
_tb_logger: Type[_TracebackLogger]
|
||||
def __init__(self, *, loop: AbstractEventLoop = ...) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
@@ -12,12 +12,12 @@ _ClientConnectedCallback = Callable[[StreamReader, StreamWriter], Optional[Await
|
||||
__all__: List[str]
|
||||
|
||||
class IncompleteReadError(EOFError):
|
||||
expected = ... # type: Optional[int]
|
||||
partial = ... # type: bytes
|
||||
expected: Optional[int]
|
||||
partial: bytes
|
||||
def __init__(self, partial: bytes, expected: Optional[int]) -> None: ...
|
||||
|
||||
class LimitOverrunError(Exception):
|
||||
consumed = ... # type: int
|
||||
consumed: int
|
||||
def __init__(self, message: str, consumed: int) -> None: ...
|
||||
|
||||
@coroutines.coroutine
|
||||
|
||||
@@ -7,15 +7,15 @@ from typing import Any, Generator, List, Optional, Text, Tuple, Union, IO
|
||||
|
||||
__all__: List[str]
|
||||
|
||||
PIPE = ... # type: int
|
||||
STDOUT = ... # type: int
|
||||
DEVNULL = ... # type: int
|
||||
PIPE: int
|
||||
STDOUT: int
|
||||
DEVNULL: int
|
||||
|
||||
class SubprocessStreamProtocol(streams.FlowControlMixin,
|
||||
protocols.SubprocessProtocol):
|
||||
stdin = ... # type: Optional[streams.StreamWriter]
|
||||
stdout = ... # type: Optional[streams.StreamReader]
|
||||
stderr = ... # type: Optional[streams.StreamReader]
|
||||
stdin: Optional[streams.StreamWriter]
|
||||
stdout: Optional[streams.StreamReader]
|
||||
stderr: Optional[streams.StreamReader]
|
||||
def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ...
|
||||
def connection_made(self, transport: transports.BaseTransport) -> None: ...
|
||||
def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ...
|
||||
@@ -24,10 +24,10 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
|
||||
|
||||
|
||||
class Process:
|
||||
stdin = ... # type: Optional[streams.StreamWriter]
|
||||
stdout = ... # type: Optional[streams.StreamReader]
|
||||
stderr = ... # type: Optional[streams.StreamReader]
|
||||
pid = ... # type: int
|
||||
stdin: Optional[streams.StreamWriter]
|
||||
stdout: Optional[streams.StreamReader]
|
||||
stderr: Optional[streams.StreamReader]
|
||||
pid: int
|
||||
def __init__(self,
|
||||
transport: transports.BaseTransport,
|
||||
protocol: protocols.BaseProtocol,
|
||||
|
||||
Reference in New Issue
Block a user