From 8c11393d3158275a5489571038294f610835a2b3 Mon Sep 17 00:00:00 2001 From: Chris Rose Date: Mon, 14 Mar 2022 09:07:27 -0700 Subject: [PATCH] Typeshed cherry-pick: Use import instead of type alias in `email/message.pyi` (#7022) (#12340) Co-authored-by: Chris Rose --- mypy/typeshed/stdlib/email/message.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mypy/typeshed/stdlib/email/message.pyi b/mypy/typeshed/stdlib/email/message.pyi index 7d5eb4500d8f..b89c8f8ec167 100644 --- a/mypy/typeshed/stdlib/email/message.pyi +++ b/mypy/typeshed/stdlib/email/message.pyi @@ -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