mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
bring protocols.pyi more inline with documentation (#2421)
This commit is contained in:
committed by
Sebastian Rittau
parent
761b620e1a
commit
5ed39dd8ce
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user