Skip to content
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

Merged
merged 6 commits into from Mar 7, 2021
Merged

Bug pylint 3974 #918

merged 6 commits into from Mar 7, 2021

Conversation

hippo91
Copy link
Contributor

@hippo91 hippo91 commented Mar 5, 2021

Steps

  • For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • Write a good description on what the PR does.

Description

This PR fixes the way an Import node is detected as a valid numpy import. It concerns only the numpy's brain.
The _is_a_numpy_module function was bugged because it returns True for import numpy as alias but False for the simplest case import numpy.

Type of Changes

Type
🐛 Bug fix

Related Issue

Closes pylint-dev/pylint#3974

@hippo91
Copy link
Contributor Author

hippo91 commented Mar 5, 2021

@cdce8p for an unknown reason, i cannot add you as a reviewer but i would be happy to have your opinion on this PR.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a 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 !

tests/unittest_brain_numpy_core_multiarray.py Show resolved Hide resolved
tests/unittest_brain_numpy_core_multiarray.py Outdated Show resolved Hide resolved
Copy link
Member

@cdce8p cdce8p left a 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.

@hippo91 hippo91 merged commit 45aac90 into pylint-dev:master Mar 7, 2021
@hippo91 hippo91 deleted the bug_pylint_3974 branch March 7, 2021 11:04
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.5.2 milestone Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return value of numpy.bincount misidentified as tuple instead of ndarray
3 participants