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

"no-member" false positive in inherited dataclasses #7325

Closed
ppentchev opened this issue Aug 20, 2022 · 1 comment
Closed

"no-member" false positive in inherited dataclasses #7325

ppentchev opened this issue Aug 20, 2022 · 1 comment
Labels
Duplicate 🐫 Duplicate of an already existing issue

Comments

@ppentchev
Copy link

Bug description

pyclass.txt
Hi,

Thanks a lot for working on pylint, astroid, and the related projects!

It seems that pylint does not "listen to" isinstance() checks and type annotations when a program attempts to make sure that a variable that is guaranteed to be an instance of a base class is actually an instance of a specific class derived from the base one. See the attached file; pylint 2.14.5 / astroid 2.11.7 issue "no-member" messages for both the print(expr.name) and print(expr.op_name) lines.

Thanks in advance for your time, and keep up the great work!

Configuration

No response

Command used

pylint pyclass.py

Pylint output

************* Module pyclass
pyclass.py:86:10: E1101: Instance of 'Expr' has no 'name' member (no-member)
pyclass.py:97:10: E1101: Instance of 'Expr' has no 'op_name' member (no-member)

------------------------------------------------------------------
Your code has been rated at 7.83/10 (previous run: 7.73/10, +0.1

Expected behavior

No diagnostic messages at all.

Pylint version

pylint 2.14.5
astroid 2.11.7
Python 3.10.6 (main, Aug 10 2022, 11:19:32) [GCC 12.1.0]

OS / Environment

Debian testing on a x86_64 host, Python from the python3 package (3.10.5-3), pylint installed via tox with a deps: pylint >= 2.14 testenv configuration.

Additional dependencies

No response

@ppentchev ppentchev added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Aug 20, 2022
@jacobtylerwalls
Copy link
Member

Duplicate of #4693 (and in turn #1162)

@jacobtylerwalls jacobtylerwalls closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2022
@jacobtylerwalls jacobtylerwalls added Duplicate 🐫 Duplicate of an already existing issue and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants