mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -12,7 +12,7 @@ __all__ = ["Client", "Listener", "Pipe", "wait"]
|
||||
_Address: TypeAlias = Union[str, tuple[str, int]]
|
||||
|
||||
class _ConnectionBase:
|
||||
def __init__(self, handle: SupportsIndex, readable: bool = ..., writable: bool = ...) -> None: ...
|
||||
def __init__(self, handle: SupportsIndex, readable: bool = True, writable: bool = True) -> None: ...
|
||||
@property
|
||||
def closed(self) -> bool: ... # undocumented
|
||||
@property
|
||||
@@ -21,10 +21,10 @@ class _ConnectionBase:
|
||||
def writable(self) -> bool: ... # undocumented
|
||||
def fileno(self) -> int: ...
|
||||
def close(self) -> None: ...
|
||||
def send_bytes(self, buf: ReadableBuffer, offset: int = ..., size: int | None = ...) -> None: ...
|
||||
def send_bytes(self, buf: ReadableBuffer, offset: int = 0, size: int | None = None) -> None: ...
|
||||
def send(self, obj: Any) -> None: ...
|
||||
def recv_bytes(self, maxlength: int | None = ...) -> bytes: ...
|
||||
def recv_bytes_into(self, buf: Any, offset: int = ...) -> int: ...
|
||||
def recv_bytes(self, maxlength: int | None = None) -> bytes: ...
|
||||
def recv_bytes_into(self, buf: Any, offset: int = 0) -> int: ...
|
||||
def recv(self) -> Any: ...
|
||||
def poll(self, timeout: float | None = ...) -> bool: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
@@ -39,7 +39,7 @@ if sys.platform == "win32":
|
||||
|
||||
class Listener:
|
||||
def __init__(
|
||||
self, address: _Address | None = ..., family: str | None = ..., backlog: int = ..., authkey: bytes | None = ...
|
||||
self, address: _Address | None = None, family: str | None = None, backlog: int = 1, authkey: bytes | None = None
|
||||
) -> None: ...
|
||||
def accept(self) -> Connection: ...
|
||||
def close(self) -> None: ...
|
||||
@@ -55,15 +55,15 @@ class Listener:
|
||||
def deliver_challenge(connection: Connection, authkey: bytes) -> None: ...
|
||||
def answer_challenge(connection: Connection, authkey: bytes) -> None: ...
|
||||
def wait(
|
||||
object_list: Iterable[Connection | socket.socket | int], timeout: float | None = ...
|
||||
object_list: Iterable[Connection | socket.socket | int], timeout: float | None = None
|
||||
) -> list[Connection | socket.socket | int]: ...
|
||||
def Client(address: _Address, family: str | None = ..., authkey: bytes | None = ...) -> Connection: ...
|
||||
def Client(address: _Address, family: str | None = None, authkey: bytes | None = None) -> Connection: ...
|
||||
|
||||
# N.B. Keep this in sync with multiprocessing.context.BaseContext.Pipe.
|
||||
# _ConnectionBase is the common base class of Connection and PipeConnection
|
||||
# and can be used in cross-platform code.
|
||||
if sys.platform != "win32":
|
||||
def Pipe(duplex: bool = ...) -> tuple[Connection, Connection]: ...
|
||||
def Pipe(duplex: bool = True) -> tuple[Connection, Connection]: ...
|
||||
|
||||
else:
|
||||
def Pipe(duplex: bool = ...) -> tuple[PipeConnection, PipeConnection]: ...
|
||||
|
||||
Reference in New Issue
Block a user