-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-59000: Fix pdb breakpoint resolution for class methods when module not imported #141949
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
Merged
+20
−1
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7844490
fix incorrectly pdb break
cocolato 701050f
Merge branch 'main' into fix_pdb_break
cocolato 7b8fe20
fix test
cocolato 25c8819
fix test
cocolato df88534
fix test
cocolato b59d79a
fix test
cocolato 53ac260
fix test
cocolato File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Library/2025-11-25-16-00-29.gh-issue-59000.YtOyJy.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix :mod:`pdb` breakpoint resolution for class methods when the module defining the class is not imported. |
Oops, something went wrong.
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.
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.
You are testing the wrong thing. You should test
C.foo, notC.c_foo. So a good practice is to confirm that your test fails before your fix and passes after. Also from the other PR - do not test what you don't want to. Make the test minimal.C.c_foois not important here. Let's simplify the test.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.
Thank you for taking the time to review. I have made some changes.
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.
You are still testing too much. The purpose of a regression test is to test for the specific thing you fixed. When other developers read this test in the future, they should understand what is the bug back then. It's different than a feature test which needs to be comprehensive.
The only thing in this fix is that the user should not be able to set a breakpoint for
C.fooiffooexists - that's the thing you should test for. All the other stuff are not related. Let's minimize the test case so it tests just this case. And by "minimize", I meant you can't delete anything anymore because every line is useful.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.
Thanks again for your review! I've pared the test cases down to the minimum needed.