-
-
Notifications
You must be signed in to change notification settings - Fork 355
Do not infer a shadowed builtin as the builtin #3211
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
Open
teddytennant
wants to merge
9
commits into
pylint-dev:main
Choose a base branch
from
teddytennant:fix-shadowed-builtin-inference
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+490
β6
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e408391
Do not infer a shadowed builtin as the builtin
teddytennant 5defcd0
Handle builtins imports and defaults in shadow check
teddytennant 8d58ab3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] de84634
Look up names nested in default values in the enclosing scope
teddytennant 3c9874e
Note the wider shadowing behaviour in the news fragment
Pierre-Sassoulas 7721873
Update doc/whatsnew/fragments/3211.bugfix
Pierre-Sassoulas 70c3673
Add xfail tests for the two remaining shadowing holes
Pierre-Sassoulas 2ecc442
Close the two remaining builtin shadowing holes
teddytennant 6203fb3
Add xfail tests for two holes the primer turned up
Pierre-Sassoulas 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
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,7 @@ | ||
| The builtin inference tips no longer fire on a name that shadows the builtin | ||
| they are registered for. They were selected on the identifier alone, so a | ||
| parameter named ``type`` or a function named ``len`` was still inferred as a | ||
| call to the builtin. | ||
|
|
||
| Refs #3211 | ||
| Closes pylint-dev/pylint#10994 |
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.
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 prevents the use of
_inference_tip_cachedlater, not sure if it's worth resturcturing for.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.
Yeah, fair point. I left the check in the tip so the cheap name filter stays as-is. Pulling it into the predicate (or otherwise making misses cacheable) felt like a bigger reshuffle than this bug needs. Easy to revisit if it shows up hot.