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
Bug pylint 3974 #918
Bug pylint 3974 #918
Conversation
…en numpy is imported without alias whereas it is ok when numpy is imported with an alias. It should be investigated but is probably beyond the scope of this work.
@cdce8p for an unknown reason, i cannot add you as a reviewer but i would be happy to have your opinion on this PR. |
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.
False positives with numpy are annoying, I like this !
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.
The change looks reasonable. Although I know too little about astroid, to evaluate it without debugging 😅
I'm not a member of PyCQA
and don't have any permissions for either repo (astroid and pylint). That's probably why you couldn't request a review from me.
Steps
Description
This PR fixes the way an Import node is detected as a valid
numpy
import. It concerns only thenumpy
's brain.The
_is_a_numpy_module
function was bugged because it returns True forimport numpy as alias
but False for the simplest caseimport numpy
.Type of Changes
Related Issue
Closes pylint-dev/pylint#3974