mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -59,19 +59,19 @@ if sys.version_info < (3, 8):
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
async def open_connection(
|
||||
host: str | None = ...,
|
||||
port: int | str | None = ...,
|
||||
host: str | None = None,
|
||||
port: int | str | None = None,
|
||||
*,
|
||||
limit: int = ...,
|
||||
limit: int = 65536,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
**kwds: Any,
|
||||
) -> tuple[StreamReader, StreamWriter]: ...
|
||||
async def start_server(
|
||||
client_connected_cb: _ClientConnectedCallback,
|
||||
host: str | Sequence[str] | None = ...,
|
||||
port: int | str | None = ...,
|
||||
host: str | Sequence[str] | None = None,
|
||||
port: int | str | None = None,
|
||||
*,
|
||||
limit: int = ...,
|
||||
limit: int = 65536,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
**kwds: Any,
|
||||
) -> Server: ...
|
||||
@@ -100,10 +100,10 @@ else:
|
||||
if sys.platform != "win32":
|
||||
if sys.version_info >= (3, 10):
|
||||
async def open_unix_connection(
|
||||
path: StrPath | None = ..., *, limit: int = ..., **kwds: Any
|
||||
path: StrPath | None = None, *, limit: int = 65536, **kwds: Any
|
||||
) -> tuple[StreamReader, StreamWriter]: ...
|
||||
async def start_unix_server(
|
||||
client_connected_cb: _ClientConnectedCallback, path: StrPath | None = ..., *, limit: int = ..., **kwds: Any
|
||||
client_connected_cb: _ClientConnectedCallback, path: StrPath | None = None, *, limit: int = 65536, **kwds: Any
|
||||
) -> Server: ...
|
||||
else:
|
||||
async def open_unix_connection(
|
||||
@@ -119,14 +119,14 @@ if sys.platform != "win32":
|
||||
) -> Server: ...
|
||||
|
||||
class FlowControlMixin(protocols.Protocol):
|
||||
def __init__(self, loop: events.AbstractEventLoop | None = ...) -> None: ...
|
||||
def __init__(self, loop: events.AbstractEventLoop | None = None) -> None: ...
|
||||
|
||||
class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
|
||||
def __init__(
|
||||
self,
|
||||
stream_reader: StreamReader,
|
||||
client_connected_cb: _ClientConnectedCallback | None = ...,
|
||||
loop: events.AbstractEventLoop | None = ...,
|
||||
client_connected_cb: _ClientConnectedCallback | None = None,
|
||||
loop: events.AbstractEventLoop | None = None,
|
||||
) -> None: ...
|
||||
|
||||
class StreamWriter:
|
||||
@@ -146,15 +146,15 @@ class StreamWriter:
|
||||
def close(self) -> None: ...
|
||||
def is_closing(self) -> bool: ...
|
||||
async def wait_closed(self) -> None: ...
|
||||
def get_extra_info(self, name: str, default: Any = ...) -> Any: ...
|
||||
def get_extra_info(self, name: str, default: Any = None) -> Any: ...
|
||||
async def drain(self) -> None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
async def start_tls(
|
||||
self, sslcontext: ssl.SSLContext, *, server_hostname: str | None = ..., ssl_handshake_timeout: float | None = ...
|
||||
self, sslcontext: ssl.SSLContext, *, server_hostname: str | None = None, ssl_handshake_timeout: float | None = None
|
||||
) -> None: ...
|
||||
|
||||
class StreamReader(AsyncIterator[bytes]):
|
||||
def __init__(self, limit: int = ..., loop: events.AbstractEventLoop | None = ...) -> None: ...
|
||||
def __init__(self, limit: int = 65536, loop: events.AbstractEventLoop | None = None) -> None: ...
|
||||
def exception(self) -> Exception: ...
|
||||
def set_exception(self, exc: Exception) -> None: ...
|
||||
def set_transport(self, transport: transports.BaseTransport) -> None: ...
|
||||
@@ -164,7 +164,7 @@ class StreamReader(AsyncIterator[bytes]):
|
||||
async def readline(self) -> bytes: ...
|
||||
# Can be any buffer that supports len(); consider changing to a Protocol if PEP 688 is accepted
|
||||
async def readuntil(self, separator: bytes | bytearray | memoryview = ...) -> bytes: ...
|
||||
async def read(self, n: int = ...) -> bytes: ...
|
||||
async def read(self, n: int = -1) -> bytes: ...
|
||||
async def readexactly(self, n: int) -> bytes: ...
|
||||
def __aiter__(self: Self) -> Self: ...
|
||||
async def __anext__(self) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user