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 'no-member' on inner class of NamedTuple #4370

Closed
Lambda-Logan opened this issue Apr 17, 2021 · 1 comment · Fixed by pylint-dev/astroid#1166 or #4976
Closed

False 'no-member' on inner class of NamedTuple #4370

Lambda-Logan opened this issue Apr 17, 2021 · 1 comment · Fixed by pylint-dev/astroid#1166 or #4976
Assignees
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Good first issue Friendly and approachable by new contributors Help wanted 🙏 Outside help would be appreciated, good for new contributors
Milestone

Comments

@Lambda-Logan
Copy link

The following produces a 'no-member' error.

from typing import NamedTuple


class Ax(NamedTuple):
    class Bx:
        b = 0


print(Ax.Bx.b)

>>> pylint_no_member.py:9:6: E1101: Class 'Ax' has no 'Bx' member (no-member)

However, if Ax doesn't inherent from NamedTuple then it's fine.

Ubuntu 20.04.1 LTS
pylint 2.4.4
astroid 2.3.3
Python 3.8.5 (default, Jan 27 2021, 15:41:15) 
[GCC 9.3.0]
@Pierre-Sassoulas Pierre-Sassoulas added Good first issue Friendly and approachable by new contributors False Positive 🦟 A message is emitted but nothing is wrong with the code Help wanted 🙏 Outside help would be appreciated, good for new contributors labels Apr 17, 2021
@Pierre-Sassoulas
Copy link
Member

Thank you for the report, I can reproduce this.

@dimp-gh dimp-gh self-assigned this Sep 6, 2021
dimp-gh added a commit to dimp-gh/astroid that referenced this issue Sep 6, 2021
dimp-gh added a commit to dimp-gh/pylint that referenced this issue Sep 6, 2021
After pylint-dev/astroid#1166 is merged, this test should become green.
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.11.0 milestone Sep 6, 2021
Pierre-Sassoulas pushed a commit to dimp-gh/pylint that referenced this issue Sep 14, 2021
After pylint-dev/astroid#1166 is merged, this test should become green.
Pierre-Sassoulas pushed a commit that referenced this issue Sep 14, 2021
After pylint-dev/astroid#1166 is merged, this test should become green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Good first issue Friendly and approachable by new contributors Help wanted 🙏 Outside help would be appreciated, good for new contributors
Projects
None yet
3 participants