mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use Union[bytes, Text] instead of AnyStr (#1819)
This commit is contained in:
committed by
Matthias Kramm
parent
76c733dc5b
commit
9429ac070b
@@ -1,5 +1,5 @@
|
||||
from asyncio import transports
|
||||
from typing import AnyStr, List, Tuple
|
||||
from typing import List, Text, Tuple, Union
|
||||
|
||||
__all__: List[str]
|
||||
|
||||
@@ -15,10 +15,10 @@ class Protocol(BaseProtocol):
|
||||
def eof_received(self) -> bool: ...
|
||||
|
||||
class DatagramProtocol(BaseProtocol):
|
||||
def datagram_received(self, data: AnyStr, addr: Tuple[str, int]) -> None: ...
|
||||
def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ...
|
||||
def error_received(self, exc: Exception) -> None: ...
|
||||
|
||||
class SubprocessProtocol(BaseProtocol):
|
||||
def pipe_data_received(self, fd: int, data: AnyStr) -> None: ...
|
||||
def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ...
|
||||
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
|
||||
def process_exited(self) -> None: ...
|
||||
|
||||
@@ -3,7 +3,7 @@ from asyncio import protocols
|
||||
from asyncio import streams
|
||||
from asyncio import transports
|
||||
from asyncio.coroutines import coroutine
|
||||
from typing import Any, AnyStr, Generator, List, Optional, Tuple, Union, IO
|
||||
from typing import Any, Generator, List, Optional, Text, Tuple, Union, IO
|
||||
|
||||
__all__: List[str]
|
||||
|
||||
@@ -18,7 +18,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
|
||||
stderr = ... # type: 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: AnyStr) -> None: ...
|
||||
def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ...
|
||||
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
|
||||
def process_exited(self) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user