diff --git a/stdlib/email/charset.pyi b/stdlib/email/charset.pyi index d61950a26..f8de016ab 100644 --- a/stdlib/email/charset.pyi +++ b/stdlib/email/charset.pyi @@ -19,11 +19,11 @@ class Charset: def get_body_encoding(self) -> str | Callable[[Message], None]: ... def get_output_charset(self) -> str | None: ... def header_encode(self, string: str) -> str: ... - def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ... + def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str | None]: ... @overload def body_encode(self, string: None) -> None: ... @overload - def body_encode(self, string: str) -> str: ... + def body_encode(self, string: str | bytes) -> str: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, __value: object) -> bool: ... diff --git a/stdlib/email/policy.pyi b/stdlib/email/policy.pyi index dc7f18489..804044031 100644 --- a/stdlib/email/policy.pyi +++ b/stdlib/email/policy.pyi @@ -53,7 +53,7 @@ compat32: Compat32 class EmailPolicy(Policy): utf8: bool refold_source: str - header_factory: Callable[[str, str], str] + header_factory: Callable[[str, Any], Any] content_manager: ContentManager def __init__( self, @@ -70,9 +70,9 @@ class EmailPolicy(Policy): content_manager: ContentManager = ..., ) -> None: ... def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ... - def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ... - def header_fetch_parse(self, name: str, value: str) -> str: ... - def fold(self, name: str, value: str) -> str: ... + def header_store_parse(self, name: str, value: Any) -> tuple[str, Any]: ... + def header_fetch_parse(self, name: str, value: str) -> Any: ... + def fold(self, name: str, value: str) -> Any: ... def fold_binary(self, name: str, value: str) -> bytes: ... default: EmailPolicy