-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Don't run whats_left with older CPython versions #4847
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
Conversation
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}") |
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.
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.
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.
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
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.
ran this locally and looks good to me, like the alignment of signatures! Apart from youknowone's suggestion, should be gtg. Thanks!
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
Thank you for contributing! |
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