-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Merge TypedDicts from typeshed #4707
Conversation
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.
Thank you very much!
setuptools/command/easy_install.py
Outdated
@@ -2038,14 +2038,19 @@ def chmod(path, mode): | |||
log.debug("chmod failed: %s", e) | |||
|
|||
|
|||
class SplitArgs(TypedDict, total=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.
Should we prefer introducing private terms?
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.
Is it intended for devs to assign to split_args
at any point (and I mean re-assigning to the attribute directly, not mutating the dictionary)? If not, it could be made private.
The same reasoning can be applied to TypeDict used solely in args vs return types. To let users instantiate/reference the TypedDict w/o importing a private symbol.
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.
Ideally users should not be importing more symbols in general 😅, and more so from deprecated modules.
Hopefully devs will not have to assign new values, but if they do I think they should simply use a literal dict with the correct keys. Mypy should be able to cope with that right?
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.
Yes using a dict literal to assign to a typeddict should be fine. The module being deprecated is even more reason. I'll make them both private.
If a user really needs to they can still import the private symbol for reference.
df16933
to
0353c55
Compare
0353c55
to
eca1d66
Compare
Summary of changes
Follow-up to #4504, works towards #2345
I didn't include TypeDicts for
**kwargs
params as part of this PR. keyword args will be its own thing.Pull Request Checklist
newsfragments/
. (not public facing yet)(See documentation for details)