-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-104050: Argument Clinic: Annotate CLanguage.render_option_group_parsing() #106929
gh-104050: Argument Clinic: Annotate CLanguage.render_option_group_parsing() #106929
Conversation
erlend-aasland
commented
Jul 20, 2023
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: Add type annotations to clinic.py #104050
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.
Some unnecessary use of quoted annotations now that we have from __future__ import annotations
at the top of the file:
Extra quotes around Parameter are not needed anymore Co-authored-by: Alex Waygood <[email protected]>
Rip out ParamIter
@@ -1415,6 +1419,7 @@ def render_option_group_parsing(self, f, template_dict): | |||
group = required | |||
else: | |||
right.append(group) | |||
assert group is not None |
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.
This is fine for now, but I feel like there's probably a simpler way of writing the code immediately above that would be easier to understand and not require this assertion here for mypy
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. We should accumulate these smells in the modernising-issue, so we don't forget. Or we can just grep for asserts.
Co-authored-by: Alex Waygood <[email protected]>
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, thanks!
Thanks, the same! |