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-positive E1101 (no-member) inheriting from set[int] #10031

Open
bersbersbers opened this issue Oct 18, 2024 · 1 comment
Open

False-positive E1101 (no-member) inheriting from set[int] #10031

bersbersbers opened this issue Oct 18, 2024 · 1 comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@bersbersbers
Copy link

bersbersbers commented Oct 18, 2024

Bug description

# pylint: disable=missing-docstring
class Ints(set[int]):
    def __init__(self):
        self |= {0}
        self.member = True

    def method(self) -> None:
        print(self.member)

print(list(Ints()))
print(Ints().member)

Command used

pylint bug.py

Pylint output

************* Module bug
bug.py:8:14: E1101: Instance of 'Ints' has no 'member' member (no-member)

------------------------------------------------------------------
Your code has been rated at 2.86/10 (previous run: 2.86/10, +0.00)

Expected behavior

No error.

Pylint version

pylint 3.3.1
astroid 3.3.5
Python 3.13.0 (tags/v3.13.0:60403a5, Oct 7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)]

OS / Environment

Windows 11 24H2

@bersbersbers bersbersbers added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Oct 18, 2024
@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Oct 28, 2024
@Pierre-Sassoulas
Copy link
Member

Thank you for opening the issue, I can reproduce on main.

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 Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

No branches or pull requests

2 participants