Skip to content

Propagate EmailMessage generics#15639

Merged
hauntsaninja merged 2 commits intopython:mainfrom
tamird:email-message-generic
Apr 15, 2026
Merged

Propagate EmailMessage generics#15639
hauntsaninja merged 2 commits intopython:mainfrom
tamird:email-message-generic

Conversation

@tamird
Copy link
Copy Markdown
Contributor

@tamird tamird commented Apr 10, 2026

Commit 56db30e made Message generic,
but left EmailMessage inheriting from bare MIMEPart.

Propagate the same type parameters to EmailMessage so it is typed
consistently, and add a regression test case covering the generic
EmailMessage behavior.

Commit 56db30e made Message generic,
but left EmailMessage inheriting from bare MIMEPart.

Propagate the same type parameters to EmailMessage so it is typed
consistently, and add a regression test case covering the generic
EmailMessage behavior.
@github-actions

This comment has been minimized.

Commit 56db30e made Message generic and
switched get_body() and iter_parts() to return
MIMEPart[_HeaderRegistryT].

That dropped the second type parameter, so the header parameter type
defaulted to Any. Preserve both type parameters in the return types and
add a regression test covering get_body() and iter_parts().
@github-actions
Copy link
Copy Markdown
Contributor

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

@tamird
Copy link
Copy Markdown
Contributor Author

tamird commented Apr 13, 2026

@Avasam @srittau could you PTAL?

@tamird
Copy link
Copy Markdown
Contributor Author

tamird commented Apr 14, 2026

Could someone kindly merge this?

@hauntsaninja hauntsaninja merged commit bd18cc6 into python:main Apr 15, 2026
51 checks passed
@tamird tamird deleted the email-message-generic branch April 15, 2026 19:42
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.

2 participants