-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
(proposal) Always use the suggestion mode for no-member
/ c-extension-no-member
#9962
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
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.
I agree with the change! Do we need tests?
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.
Principle makes sense to me.
@@ -1202,24 +1178,24 @@ def _get_nomember_msgid_hint( | |||
node: nodes.Attribute | nodes.AssignAttr | nodes.DelAttr, | |||
owner: SuccessfulInferenceResult, | |||
) -> tuple[Literal["c-extension-no-member", "no-member"], str]: | |||
suggestions_are_possible = self._suggestion_mode and isinstance( | |||
owner, nodes.Module | |||
if isinstance(owner, nodes.Module) and _is_c_extension(owner): |
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_c_extension already checks isinstance(..., Module).
return "c-extension-no-member", "" | ||
if not self.linter.config.missing_member_hint: | ||
return "no-member", "" | ||
names = _similar_names( |
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.
Could you share a profile run for a project like pylint or astroid and let us know the total time spent in _similar_names? That might impact whether we want to lru_cache it, potentially after fiddling with when attname
is filtered out. Let me know if I'm speaking in too much shorthand.
b370363
to
7a7170f
Compare
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit 7a7170f |
Type of Changes
Description
Work in progress to know what others think. There's no reason to add to not suggest imo (?), so we can remove the option too in the spirit of simplification.