Repository navigation
gh-152315: Add a suggestion for self #152326
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
+201
−26
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
87ffa90
Suggest missing 'self' when a method is called with too many position…
SurenNihalani b73f5cd
Respond to comments about giving typeerror without hint and changing …
SurenNihalani dfa5f6f
Add test for happy path
SurenNihalani 02dfa50
Missing semicolon
SurenNihalani 6165cd1
Fix tests
SurenNihalani 118a24c
Be simpler
SurenNihalani 0a52b0b
Change methodology
SurenNihalani aaf51cf
Add misc
SurenNihalani 887456a
Dont give hints when first arg is already named self
SurenNihalani b9c2e70
gh-152315: Refine missing self TypeError hint
SurenNihalani f61cf66
gh-152315: Use descriptive TypeError test fixtures
SurenNihalani a67750f
gh-152315: Document missing self heuristic
SurenNihalani db5f2a4
gh-152315: Cover metaclass descriptors
SurenNihalani 6721c67
gh-152315: Rename metaclass test fixture
SurenNihalani c246bad
gh-152315: Align missing self docs wording
SurenNihalani 5cd94fe
gh-152315: Add agent guidance
SurenNihalani 5519866
gh-152315: Remove agent guidance
SurenNihalani a8bf860
gh-152315: Clarify missing self heuristic
SurenNihalani f9fd4da
gh-152315: Remove redundant argcount check
SurenNihalani 57aca39
gh-152315: Compute missing self hint only when error is raised
SurenNihalani 6ec11c7
gh-152315: Pin first argument for missing self hint
SurenNihalani bf64b96
gh-152315: Initialize first_argument before the fail_pre_positional exit
SurenNihalani 498062e
gh-152315: Drop comment
SurenNihalani e158625
Merge remote-tracking branch 'origin/main' into missing_self
SurenNihalani 97bbc04
Undo calls
SurenNihalani 587703c
Update tests
SurenNihalani 2e5ee8d
Rename for consistency
SurenNihalani f875f81
Fix all tests
SurenNihalani 20b5767
gh-152315: Fix misleading test names and drop duplicate tests
SurenNihalani 7914cdd
gh-152315: Fix comment style and typos in suggest_missing_self
SurenNihalani 725a1fb
gh-152315: Rename TypeError message helper to match assertIn semantics
SurenNihalani 7db1dac
gh-152315: Add tests for no-hint branches in suggest_missing_self
SurenNihalani d0a49ad
gh-152315: Make cls-named-parameter test exercise the name check
SurenNihalani 27b39bc
gh-152315: Assert hint absence in no-suggest tests
SurenNihalani da63250
gh-152315: Strip trailing whitespace in test_call
SurenNihalani 266a87e
Merge remote-tracking branch 'origin/main' into missing_self
SurenNihalani f6b4c69
Add sobolevn's second arg as self test case
SurenNihalani 59d6d1b
Fix ZeroIntensity's comments
SurenNihalani 9f6d715
Use regex
SurenNihalani a4c2623
Remove unnecessary comment
SurenNihalani 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
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Core_and_Builtins/2026-06-26-20-37-22.gh-issue-152315.iVS7u5.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,3 @@ | ||
| :exc:`TypeError` messages for some instance methods called with too many | ||
| positional arguments now suggest checking whether the method definition is | ||
| missing the ``self`` parameter. |
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
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.
Uh oh!
There was an error while loading. Please reload this page.