Use import instead of type alias in email/message.pyi (#7022)

This commit is contained in:
Alex Waygood
2022-01-24 12:00:29 +00:00
committed by GitHub
parent c8bfa511f7
commit 6346464aed

View File

@@ -2,7 +2,9 @@ from email.charset import Charset
from email.contentmanager import ContentManager
from email.errors import MessageDefect
from email.policy import Policy
from typing import Any, Generator, Iterator, Optional, Sequence, TypeVar, Union
# using a type alias ("_HeaderType = Any") breaks mypy, who knows why
from typing import Any, Any as _HeaderType, Generator, Iterator, Optional, Sequence, TypeVar, Union
_T = TypeVar("_T")
@@ -10,7 +12,6 @@ _PayloadType = Union[list[Message], str, bytes]
_CharsetType = Union[Charset, str, None]
_ParamsType = Union[str, None, tuple[str, Optional[str], str]]
_ParamType = Union[str, tuple[Optional[str], Optional[str], str]]
_HeaderType = Any
class Message:
policy: Policy # undocumented