Don't run whats_left with older CPython versions#4847
Merged
youknowone merged 2 commits intoRustPython:mainfrom Apr 11, 2023
Merged
Don't run whats_left with older CPython versions#4847youknowone merged 2 commits intoRustPython:mainfrom
youknowone merged 2 commits intoRustPython:mainfrom
Conversation
DimitrisJim
reviewed
Apr 4, 2023
youknowone
reviewed
Apr 10, 2023
DimitrisJim
reviewed
Apr 10, 2023
| print(f"{item}{rustpy_value}") | ||
| if cpython_value is None or cpython_value.startswith("ValueError("): | ||
| cpython_value = f" {cpython_value}" | ||
| print(f"{' ' * len(item)}{cpython_value}") |
Member
There was a problem hiding this comment.
also, minor nit here, but we don't account for the potential space added in the rustpy_value on line 491 so the alignment might be off by one.
Contributor
Author
There was a problem hiding this comment.
The idea is that ValueError/None aren't signatures. The output is like
func_name(arg1, arg2)
func_name(arg1, arg2, arg3)
but we don't repeat "func_name" a second time since it's always the same and this way the output is less busy visually
func_name(arg1, arg2)
(arg1, arg2, arg3)
Then for value errors we have
func_name ValueError()
func_name(arg1, arg2, arg3)
or
func_name(arg1, arg2)
func_name None
DimitrisJim
approved these changes
Apr 10, 2023
Co-authored-by: Jeong, YunWon <[email protected]>
Member
|
Thank you for contributing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added a check that whats_left is being run with CPython 3.11 or newer, as suggested here #4255 (comment) and also put one signature under the other to make them easier to compare