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

false negative missing member #5626

Closed
dpinol opened this issue Jan 1, 2022 · 2 comments
Closed

false negative missing member #5626

dpinol opened this issue Jan 1, 2022 · 2 comments
Labels
False Negative 🦋 No message is emitted but something is wrong with the code

Comments

@dpinol
Copy link

dpinol commented Jan 1, 2022

Bug description

class Class:
    pass


def f(c: Class) -> None:
    c.shouldFail()

c = Class()
c.shouldFail()

This code should cause two E1101 no-member reports, but it only reports the second one.

Command used

pylint -E kk.py

Pylint output

kk.py:9:0: E1101: Instance of 'Class' has no 'shouldFail' member (no-member)

Expected behavior

kk.py:6:0: E1101: Instance of 'Class' has no 'shouldFail' member (no-member)
kk.py:9:0: E1101: Instance of 'Class' has no 'shouldFail' member (no-member)

Pylint version

pylint 2.12.2
astroid 2.9.1
Python 3.9.9 (main, Dec 28 2021, 17:28:48) 
[GCC 11.2.0]

OS / Environment

Can reproduce in both windows and WLS2

Additional dependencies

On a virtualenv with only pylint installed

astroid==2.9.1
isort==5.10.1
lazy-object-proxy==1.7.1
mccabe==0.6.1
platformdirs==2.4.1
pylint==2.12.2
toml==0.10.2
typing_extensions==4.0.1
wrapt==1.13.3
@dpinol dpinol added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jan 1, 2022
@Pierre-Sassoulas Pierre-Sassoulas added False Negative 🦋 No message is emitted but something is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jan 1, 2022
@DanielNoord
Copy link
Collaborator

We would need to understand typing annotations for this to work. See #4813

@Pierre-Sassoulas
Copy link
Member

Closing in favor of #4813, this depends on a global decision to take type into account or not.

@Pierre-Sassoulas Pierre-Sassoulas closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code
Projects
None yet
Development

No branches or pull requests

3 participants