-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Email example from python docs doesn't validate: Address as EmailMessage header #2863
Comments
True. Patches welcome! |
I'm not sure how. Maybe:
Or just:
|
|
I don't really like using I think I don't know how to make overloads so that if Also, it would be nice if we were able to deduce the policy from a message, in a way that, for example, |
This seems to work because the getitem and setitem have different behaviours : while the getitem mostly returns BaseHeader, the setitem seems to dynamically build a class with a parser which takes any object to build a header from. So I think aliasing |
But there is this:
|
So |
I'm okay with this too :
|
This workaround makes more sense to me, instead of the above one, no? |
Returning a Union is not ok. See python/mypy#1693 |
EmailMessage.__setitem__
should supportAddress
as a value. At least the Python docs email example think it does. See https://docs.python.org/3/library/email.examples.htmltest_mypy.py:
And then:
The text was updated successfully, but these errors were encountered: