mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
email.Message.walk yields self (#8398)
This updates the generator used by `Message` to return `Self` so that it correctly changes when a `MIMEPart` or `EmailMessage`. Fixes #8290
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Generator, Iterator, Sequence
|
||||
from email import _ParamsType, _ParamType
|
||||
from email.charset import Charset
|
||||
@@ -55,7 +56,7 @@ class Message:
|
||||
def set_boundary(self, boundary: str) -> None: ...
|
||||
def get_content_charset(self, failobj: _T = ...) -> _T | str: ...
|
||||
def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ...
|
||||
def walk(self) -> Generator[Message, None, None]: ...
|
||||
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: ...
|
||||
|
||||
Reference in New Issue
Block a user