-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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-99180: Remove traceback anchors in return and assign statements that cover all the displayed range #112670
Conversation
bb342a0
to
6e941e1
Compare
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.
Spotted some minor typos:
Hey @lysnikolaou, can you check if this is more or less what you had in mind? (I will rebase soon) |
…nts that cover all the displayed range Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Apply suggestions from code review Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> fix whitespace issue causing the lint check to fail
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 looks a lot like what I had in mind and seeing the implementation I think it's a step towards the right direction!
@pablogsal Let's merge this? |
|
…nts that cover all the displayed range (python#112670)
@@ -727,6 +724,37 @@ def output_line(lineno): | |||
|
|||
return ''.join(row) | |||
|
|||
def should_show_carets(self, start_offset, end_offset, all_lines, anchors): |
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 this method meant to be a public-API method on StackSummary
objects, or is it meant to be private API? If the former, we should probably document it at https://docs.python.org/3.13/library/traceback.html#stacksummary-objects. If the latter, maybe it should have a name prefixed with an underscore?
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.
It should be private so I am fine prefixing it with an underscore
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.
return
and simple assignment statements #99180