Add type information for asyncio.transports

This commit is contained in:
David Soria Parra
2016-01-29 16:08:57 -08:00
parent 0f5c38a2ce
commit 23ecee29d3
2 changed files with 48 additions and 0 deletions

View File

@@ -4,6 +4,14 @@ from asyncio.coroutines import (
iscoroutinefunction as iscoroutinefunction,
iscoroutine as iscoroutine,
)
from asyncio.transports import (
BaseTransport as BaseTransport,
ReadTransport as ReadTransport,
WriteTransport as WriteTransport,
Transport as Transport,
DatagramTransport as DatagramTransport,
SubprocessTransport as SubprocessTransport,
)
from asyncio.futures import (
Future as Future,
)
@@ -33,6 +41,7 @@ from asyncio.queues import (
)
__all__ = (coroutines.__all__ +
transports.__all__ +
futures.__all__ +
tasks.__all__ +
events.__all__ +

View File

@@ -0,0 +1,39 @@
from typing import Dict, Any, TypeVar, Mapping, List
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport:
def __init__(self, extra: Mapping[Any, Any] = ...) -> None: ...
def get_extra_info(self, name: Any, default: Any = ...) -> Any: ...
def is_closing(self) -> bool: ...
def close(self) -> None: ...
class ReadTransport(BaseTransport):
def pause_reading(self) -> None: ...
def resume_reading(self) -> None: ...
class WriteTransport(BaseTransport):
def set_write_buffer_limits(
self, high: int = ..., low: int = ...) -> None: ...
def get_write_buffer_size(self) -> int: ...
def write(self, data: Any) -> None: ...
def writelines(self, list_of_data: List[Any]): ...
def write_eof(self) -> None: ...
def can_write_eof(self) -> bool: ...
def abort(self) -> None: ...
class Transport(ReadTransport, WriteTransport): ...
class DatagramTransport(BaseTransport):
def sendto(self, data: Any, addr: str = ...) -> None: ...
def abort(self) -> None: ...
class SubprocessTransport(BaseTransport):
def get_pid(self) -> int: ...
def get_returncode(self) -> int: ...
def get_pipe_transport(self, fd: int) -> BaseTransport: ...
def send_signal(self, signal: int) -> int: ...
def terminate(self) -> None: ...
def kill(self) -> None: ...