Skip to content

Commit b9d8a1a

Browse files
committed
fix: [15809] Made typed_subpart_iterator generic over Message
1 parent 132ae01 commit b9d8a1a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

stdlib/email/iterators.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
from _typeshed import SupportsWrite
22
from collections.abc import Iterator
33
from email.message import Message
4+
from typing import TypeVar
5+
6+
_T = TypeVar("_T", bound=Message)
47

58
__all__ = ["body_line_iterator", "typed_subpart_iterator", "walk"]
69

710
def body_line_iterator(msg: Message, decode: bool = False) -> Iterator[str]: ...
8-
def typed_subpart_iterator(msg: Message, maintype: str = "text", subtype: str | None = None) -> Iterator[str]: ...
11+
def typed_subpart_iterator(msg: _T, maintype: str = "text", subtype: str | None = None) -> Iterator[_T]: ...
912
def walk(self: Message) -> Iterator[Message]: ...
1013

1114
# We include the seemingly private function because it is documented in the stdlib documentation.

0 commit comments

Comments
 (0)