mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Propagate EmailMessage generics (#15639)
This commit is contained in:
@@ -151,13 +151,15 @@ class Message(Generic[_HeaderT_co, _HeaderParamT_contra]):
|
||||
|
||||
class MIMEPart(Message[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]):
|
||||
def __init__(self, policy: Policy[Any] | None = None) -> None: ...
|
||||
def get_body(self, preferencelist: Sequence[str] = ("related", "html", "plain")) -> MIMEPart[_HeaderRegistryT_co] | None: ...
|
||||
def get_body(
|
||||
self, preferencelist: Sequence[str] = ("related", "html", "plain")
|
||||
) -> MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra] | None: ...
|
||||
def attach(self, payload: Self) -> None: ... # type: ignore[override]
|
||||
# The attachments are created via type(self) in the attach method. It's theoretically
|
||||
# possible to sneak other attachment types into a MIMEPart instance, but could cause
|
||||
# cause unforseen consequences.
|
||||
def iter_attachments(self) -> Iterator[Self]: ...
|
||||
def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT_co]]: ...
|
||||
def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]]: ...
|
||||
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: ...
|
||||
@@ -171,4 +173,4 @@ class MIMEPart(Message[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]):
|
||||
def as_string(self, unixfrom: bool = False, maxheaderlen: int | None = None, policy: Policy[Any] | None = None) -> str: ...
|
||||
def is_attachment(self) -> bool: ...
|
||||
|
||||
class EmailMessage(MIMEPart): ...
|
||||
class EmailMessage(MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]): ...
|
||||
|
||||
Reference in New Issue
Block a user