Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email.message: Fix invalid TypeVar usage; add some default values #9620

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 32 additions & 7 deletions stdlib/email/message.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,52 @@ class Message:
def keys(self) -> list[str]: ...
def values(self) -> list[_HeaderType]: ...
def items(self) -> list[tuple[str, _HeaderType]]: ...
def get(self, name: str, failobj: _T = ...) -> _HeaderType | _T: ...
def get_all(self, name: str, failobj: _T = ...) -> list[_HeaderType] | _T: ...
@overload
def get(self, name: str, failobj: None = None) -> _HeaderType | None: ...
@overload
def get(self, name: str, failobj: _T) -> _HeaderType | _T: ...
@overload
def get_all(self, name: str, failobj: None = None) -> list[_HeaderType] | None: ...
@overload
def get_all(self, name: str, failobj: _T) -> list[_HeaderType] | _T: ...
def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ...
def replace_header(self, _name: str, _value: _HeaderType) -> None: ...
def get_content_type(self) -> str: ...
def get_content_maintype(self) -> str: ...
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 = "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: ...
@overload
def get_params(
self, failobj: None = None, header: str = "content-type", unquote: bool = True
) -> list[tuple[str, str]] | None: ...
@overload
def get_params(self, failobj: _T, header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ...
@overload
def get_param(
self, param: str, failobj: None = None, header: str = "content-type", unquote: bool = True
) -> _ParamType | None: ...
@overload
def get_param(self, param: str, failobj: _T, header: str = "content-type", unquote: bool = True) -> _ParamType | _T: ...
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: ...
@overload
def get_filename(self, failobj: None = None) -> str | None: ...
@overload
def get_filename(self, failobj: _T) -> str | _T: ...
@overload
def get_boundary(self, failobj: None = None) -> str | None: ...
@overload
def get_boundary(self, failobj: _T) -> str | _T: ...
def set_boundary(self, boundary: str) -> None: ...
@overload
def get_content_charset(self) -> str | None: ...
@overload
def get_content_charset(self, failobj: _T) -> str | _T: ...
def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ...
@overload
def get_charsets(self, failobj: None = None) -> list[str] | None: ...
@overload
def get_charsets(self, failobj: _T) -> list[str] | _T: ...
def walk(self: Self) -> Generator[Self, None, None]: ...
def get_content_disposition(self) -> str | None: ...
def as_string(self, unixfrom: bool = False, maxheaderlen: int = 0, policy: Policy | None = None) -> str: ...
Expand Down