stdlib: add argument default values (#9501)

This commit is contained in:
Jelle Zijlstra
2023-01-18 00:37:34 -08:00
committed by GitHub
parent 6cb934291f
commit ddfaca3200
272 changed files with 2529 additions and 2467 deletions

View File

@@ -114,12 +114,12 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
chunk_left: int | None
length: int | None
will_close: bool
def __init__(self, sock: socket, debuglevel: int = ..., method: str | None = ..., url: str | None = ...) -> None: ...
def peek(self, n: int = ...) -> bytes: ...
def read(self, amt: int | None = ...) -> bytes: ...
def read1(self, n: int = ...) -> bytes: ...
def __init__(self, sock: socket, debuglevel: int = 0, method: str | None = None, url: str | None = None) -> None: ...
def peek(self, n: int = -1) -> bytes: ...
def read(self, amt: int | None = None) -> bytes: ...
def read1(self, n: int = -1) -> bytes: ...
def readinto(self, b: WriteableBuffer) -> int: ...
def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override]
def readline(self, limit: int = -1) -> bytes: ... # type: ignore[override]
@overload
def getheader(self, name: str) -> str | None: ...
@overload
@@ -148,28 +148,28 @@ class HTTPConnection:
def __init__(
self,
host: str,
port: int | None = ...,
port: int | None = None,
timeout: float | None = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
source_address: tuple[str, int] | None = None,
blocksize: int = 8192,
) -> None: ...
def request(
self,
method: str,
url: str,
body: _DataType | str | None = ...,
body: _DataType | str | None = None,
headers: Mapping[str, str] = ...,
*,
encode_chunked: bool = ...,
encode_chunked: bool = False,
) -> None: ...
def getresponse(self) -> HTTPResponse: ...
def set_debuglevel(self, level: int) -> None: ...
def set_tunnel(self, host: str, port: int | None = ..., headers: Mapping[str, str] | None = ...) -> None: ...
def set_tunnel(self, host: str, port: int | None = None, headers: Mapping[str, str] | None = None) -> None: ...
def connect(self) -> None: ...
def close(self) -> None: ...
def putrequest(self, method: str, url: str, skip_host: bool = ..., skip_accept_encoding: bool = ...) -> None: ...
def putrequest(self, method: str, url: str, skip_host: bool = False, skip_accept_encoding: bool = False) -> None: ...
def putheader(self, header: str, *argument: str) -> None: ...
def endheaders(self, message_body: _DataType | None = ..., *, encode_chunked: bool = ...) -> None: ...
def endheaders(self, message_body: _DataType | None = None, *, encode_chunked: bool = False) -> None: ...
def send(self, data: _DataType | str) -> None: ...
class HTTPSConnection(HTTPConnection):
@@ -178,15 +178,15 @@ class HTTPSConnection(HTTPConnection):
def __init__(
self,
host: str,
port: int | None = ...,
key_file: str | None = ...,
cert_file: str | None = ...,
port: int | None = None,
key_file: str | None = None,
cert_file: str | None = None,
timeout: float | None = ...,
source_address: tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = None,
*,
context: ssl.SSLContext | None = ...,
check_hostname: bool | None = ...,
blocksize: int = ...,
context: ssl.SSLContext | None = None,
check_hostname: bool | None = None,
blocksize: int = 8192,
) -> None: ...
class HTTPException(Exception): ...
@@ -203,7 +203,7 @@ class UnknownTransferEncoding(HTTPException): ...
class UnimplementedFileMode(HTTPException): ...
class IncompleteRead(HTTPException):
def __init__(self, partial: bytes, expected: int | None = ...) -> None: ...
def __init__(self, partial: bytes, expected: int | None = None) -> None: ...
partial: bytes
expected: int | None