mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
Use Self for email.message attachments (#12530)
--------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Avasam <samuel.06@hotmail.com>
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
from email.headerregistry import Address
|
||||
from email.message import EmailMessage
|
||||
from typing_extensions import assert_type
|
||||
|
||||
msg = EmailMessage()
|
||||
msg["To"] = "receiver@example.com"
|
||||
msg["From"] = Address("Sender Name", "sender", "example.com")
|
||||
|
||||
for a in msg.iter_attachments():
|
||||
assert_type(a, EmailMessage)
|
||||
|
||||
Reference in New Issue
Block a user