-
-
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
More accurate message types for email
stubs
#12104
Conversation
email
stubs
This comment has been minimized.
This comment has been minimized.
3 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
441fb8d
to
16ef0ee
Compare
This comment has been minimized.
This comment has been minimized.
|
Sounds good, wasn't 100% sure there. Let me fix that. |
|
This comment has been minimized.
This comment has been minimized.
@@ -1,17 +1,21 @@ | |||
# pyright: reportInvalidTypeVarUse=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See microsoft/pyright#8084 for some context on why we need this.
Oh and |
|
This comment has been minimized.
This comment has been minimized.
@srittau It seems like you looked into making |
Sorry to bug, but just wanted to follow-up again @srittau, or if maybe someone else is able to take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a few optional suggestions below.
Co-authored-by: Sebastian Rittau <[email protected]>
Co-authored-by: Sebastian Rittau <[email protected]>
Co-authored-by: Sebastian Rittau <[email protected]>
Thanks, accepted all of your suggestions. |
Diff from mypy_primer, showing the effect of this PR on open source code: setuptools (https://github.com/pypa/setuptools)
+ setuptools/command/bdist_wheel.py:591: error: Argument "policy" to "Generator" has incompatible type "EmailPolicy"; expected "Optional[Policy[Message[str, str]]]" [arg-type]
|
Looking at the new primer hit, I think we need to make Although I have to admit, I'm a bit lost in how all these classes work together. |
I'll take another deeper look in the next day or two, since it's a been a while since I worked on this originally now haha. |
Closing until I have time to take a look at this again. |
Fix long-standing
email.parser
issues detailed in #2417 and #10762This takes the approach recommended by @andersk and utilizies generic defaults to help us get accurate types accounting for the default arguments here without any overloads.