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

@@ -25,8 +25,8 @@ class Message:
def set_unixfrom(self, unixfrom: str) -> None: ...
def get_unixfrom(self) -> str | None: ...
def attach(self, payload: Message) -> None: ...
def get_payload(self, i: int | None = ..., decode: bool = ...) -> Any: ... # returns _PayloadType | None
def set_payload(self, payload: _PayloadType, charset: _CharsetType = ...) -> None: ...
def get_payload(self, i: int | None = None, decode: bool = False) -> Any: ... # returns _PayloadType | None
def set_payload(self, payload: _PayloadType, charset: _CharsetType = None) -> None: ...
def set_charset(self, charset: _CharsetType) -> None: ...
def get_charset(self) -> _CharsetType: ...
def __len__(self) -> int: ...
@@ -47,10 +47,10 @@ class Message:
def get_content_subtype(self) -> str: ...
def get_default_type(self) -> str: ...
def set_default_type(self, ctype: str) -> None: ...
def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> list[tuple[str, str]] | _T: ...
def get_param(self, param: str, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> _T | _ParamType: ...
def del_param(self, param: str, header: str = ..., requote: bool = ...) -> None: ...
def set_type(self, type: str, header: str = ..., requote: bool = ...) -> None: ...
def get_params(self, failobj: _T = ..., header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ...
def get_param(self, param: str, failobj: _T = ..., header: str = "content-type", unquote: bool = True) -> _T | _ParamType: ...
def del_param(self, param: str, header: str = "content-type", requote: bool = True) -> None: ...
def set_type(self, type: str, header: str = "Content-Type", requote: bool = True) -> None: ...
def get_filename(self, failobj: _T = ...) -> _T | str: ...
def get_boundary(self, failobj: _T = ...) -> _T | str: ...
def set_boundary(self, boundary: str) -> None: ...
@@ -61,18 +61,18 @@ class Message:
def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ...
def walk(self: Self) -> Generator[Self, None, None]: ...
def get_content_disposition(self) -> str | None: ...
def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., policy: Policy | None = ...) -> str: ...
def as_bytes(self, unixfrom: bool = ..., policy: Policy | None = ...) -> bytes: ...
def as_string(self, unixfrom: bool = False, maxheaderlen: int = 0, policy: Policy | None = None) -> str: ...
def as_bytes(self, unixfrom: bool = False, policy: Policy | None = None) -> bytes: ...
def __bytes__(self) -> bytes: ...
def set_param(
self,
param: str,
value: str,
header: str = ...,
requote: bool = ...,
charset: str | None = ...,
language: str = ...,
replace: bool = ...,
header: str = "Content-Type",
requote: bool = True,
charset: str | None = None,
language: str = "",
replace: bool = False,
) -> None: ...
def __init__(self, policy: Policy = ...) -> None: ...
# The following two methods are undocumented, but a source code comment states that they are public API
@@ -80,21 +80,21 @@ class Message:
def raw_items(self) -> Iterator[tuple[str, _HeaderType]]: ...
class MIMEPart(Message):
def __init__(self, policy: Policy | None = ...) -> None: ...
def __init__(self, policy: Policy | None = None) -> None: ...
def get_body(self, preferencelist: Sequence[str] = ...) -> Message | None: ...
def iter_attachments(self) -> Iterator[Message]: ...
def iter_parts(self) -> Iterator[Message]: ...
def get_content(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> Any: ...
def set_content(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ...
def make_related(self, boundary: str | None = ...) -> None: ...
def make_alternative(self, boundary: str | None = ...) -> None: ...
def make_mixed(self, boundary: str | None = ...) -> None: ...
def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ...
def set_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> None: ...
def make_related(self, boundary: str | None = None) -> None: ...
def make_alternative(self, boundary: str | None = None) -> None: ...
def make_mixed(self, boundary: str | None = None) -> None: ...
def add_related(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ...
def add_alternative(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ...
def add_attachment(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ...
def clear(self) -> None: ...
def clear_content(self) -> None: ...
def as_string(self, unixfrom: bool = ..., maxheaderlen: int | None = ..., policy: Policy | None = ...) -> str: ...
def as_string(self, unixfrom: bool = False, maxheaderlen: int | None = None, policy: Policy | None = None) -> str: ...
def is_attachment(self) -> bool: ...
class EmailMessage(MIMEPart): ...