Skip to content

Commit

Permalink
email.message: Fix invalid TypeVar usage; add some default values (
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Jan 30, 2023
1 parent 6011cac commit b5a26d1
Showing 1 changed file with 32 additions and 7 deletions.
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

0 comments on commit b5a26d1

Please sign in to comment.