bring protocols.pyi more inline with documentation (#2421)

This commit is contained in:
Zsolt Dollenstein
2018-08-31 12:56:57 +01:00
committed by Sebastian Rittau
parent 761b620e1a
commit 5ed39dd8ce
3 changed files with 6 additions and 6 deletions

View File

@@ -1,18 +1,18 @@
from asyncio import transports
from typing import List, Text, Tuple, Union
from typing import List, Optional, Text, Tuple, Union
__all__: List[str]
class BaseProtocol:
def connection_made(self, transport: transports.BaseTransport) -> None: ...
def connection_lost(self, exc: Exception) -> None: ...
def connection_lost(self, exc: Optional[Exception]) -> None: ...
def pause_writing(self) -> None: ...
def resume_writing(self) -> None: ...
class Protocol(BaseProtocol):
def data_received(self, data: bytes) -> None: ...
def eof_received(self) -> bool: ...
def eof_received(self) -> Optional[bool]: ...
class DatagramProtocol(BaseProtocol):
def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ...
@@ -20,5 +20,5 @@ class DatagramProtocol(BaseProtocol):
class SubprocessProtocol(BaseProtocol):
def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ...
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ...
def process_exited(self) -> None: ...

View File

@@ -68,7 +68,7 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
client_connected_cb: _ClientConnectedCallback = ...,
loop: Optional[events.AbstractEventLoop] = ...) -> None: ...
def connection_made(self, transport: transports.BaseTransport) -> None: ...
def connection_lost(self, exc: Exception) -> None: ...
def connection_lost(self, exc: Optional[Exception]) -> None: ...
def data_received(self, data: bytes) -> None: ...
def eof_received(self) -> bool: ...

View File

@@ -19,7 +19,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
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: ...
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ...
def process_exited(self) -> None: ...