Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up and fix email message types #13532

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Feb 24, 2025

  • 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.

Closes: #13531

srittau and others added 4 commits February 24, 2025 17:20
* 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.

Closes: python#13531
@srittau srittau changed the title Clean up email message types Clean up and fix email message types Feb 24, 2025
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

email.policy.default doesn't work with email.parser.BytesParser or email.parser.Parser
1 participant