Uh oh!
There was an error while loading. Please reload this page.
gh-104504: Run mypy on cases_generator in CI (and blacken the code) - #108090
Conversation
I am not typing expert, so there might be a more promising way to attach type hints for this.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
corona10
commented
Aug 17, 2023
cc @sobolevn |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AlexWaygood
left a comment
There was a problem hiding this comment.
You might also want to alter .github/dependabot.yml, so that you get automated updates for the mypy version pin in Tools/cases_generator/requirements-dev.txt. Currently it only checks to see if dependencies in Tools/clinic/ need updating:
cpython/.github/dependabot.yml
Lines 15 to 21 in 75b3db8
Uh oh!
There was an error while loading. Please reload this page.
gvanrossum
left a comment
There was a problem hiding this comment.
Thanks so much for doing this!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
gvanrossum
left a comment
There was a problem hiding this comment.
(Please don't git push -f -- it makes the GitHub review reset so I can't do "changes since last review".)
Uh oh!
There was an error while loading. Please reload this page.
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.x" |
There was a problem hiding this comment.
Are there constraints on x? The cases generator uses match/case so it's got to be at least Python 3.10.
There was a problem hiding this comment.
Let's use 3.11. We need dog fooding
There was a problem hiding this comment.
3.x is "the latest stable version of Python":
https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#specifying-a-python-version
That's 3.11 now, and will be 3.12 shortly after its release.
So 3.x would be fine to minimise churn on this line (for next time).
There was a problem hiding this comment.
So 3.x would be fine to minimise churn on this line (for next time).
Good!
| if popped is None and pushed is None: | ||
| popped, pushed = target_popped, target_pushed | ||
| else: | ||
| assert popped == target_popped | ||
| assert pushed == target_pushed | ||
| popped, pushed = target_popped, target_pushed |
There was a problem hiding this comment.
Those asserts need to stay -- per the comment on line 174-175, we're checking here that all targets of the pseudo have the same effects.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
gvanrossum
left a comment
There was a problem hiding this comment.
Thanks for taking black out.
gvanrossum
left a comment
There was a problem hiding this comment.
LGTM. Don't worry about the origin of the Iterator type.
Waiting comments of @AlexWaygood@hugovk before merging :) |
There was a problem hiding this comment.
FYI: You could actually use Argument Clinic to generate the Python code for the keywords. (Argument Clinic supports Python files.) I'm not suggesting you do it for this PR, though; just a thought :)
There was a problem hiding this comment.
Wow, Can I read the relevant documentation?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gvanrossum
commented
Aug 18, 2023
Thanks! |
mypyoncases_generator#104504