mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-31 21:20:23 +08:00
Clean up and fix email message types (#13532)
* Unify the `_MessageT` type var in `email._policybase`. * Use explicit type arguments for `Message` type in `_MessageT` type var. In particular, change bound from `Message[str, str]` to `Message[Any, Any]`. * Change `__init__()` overloads of `Parser` and `BytesParser` to accept `Message` objects that are not `Message[str, str]` if `_class` is not also given.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from email._policybase import _MessageT
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
from email.policy import Policy, _MessageT
|
||||
from email.policy import Policy
|
||||
|
||||
__all__ = ["MIMEMessage"]
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from collections.abc import Sequence
|
||||
from email import _ParamsType
|
||||
from email._policybase import _MessageT
|
||||
from email.mime.base import MIMEBase
|
||||
from email.policy import Policy, _MessageT
|
||||
from email.policy import Policy
|
||||
|
||||
__all__ = ["MIMEMultipart"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user