Fix and comment type mismatches in email library hints (#10437)

This commit is contained in:
Jisuk Byun
2023-07-11 16:07:04 +09:00
committed by GitHub
parent 0ab25cbf67
commit d14ab09375
2 changed files with 8 additions and 3 deletions

View File

@@ -1,4 +1,6 @@
from collections.abc import Iterator
from collections.abc import Callable, Iterator
from email.message import Message
from typing import overload
__all__ = ["Charset", "add_alias", "add_charset", "add_codec"]
@@ -14,10 +16,13 @@ class Charset:
input_codec: str | None
output_codec: str | None
def __init__(self, input_charset: str = "us-ascii") -> None: ...
def get_body_encoding(self) -> str: ...
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]: ...
@overload
def body_encode(self, string: None) -> None: ...
@overload
def body_encode(self, string: str) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, __value: object) -> bool: ...