-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation
Description
Bug description
The following code makes pylint report no-member
for the last line:
from dataclasses import dataclass
@dataclass
class Foo:
name: str
val: int
lorem = (Foo(name="lorem", val=0), 0)
ipsum = (Foo(name="ipsum", val=1), 1)
dolor = (Foo(name="dolor", val=2), 2)
names = [sth.name for sth, _ in [lorem, ipsum, dolor]]
Command used
pylint
Pylint output
pyt.py:14:9: E1101: Instance of 'tuple' has no 'name' member (no-member)
Expected behavior
No error is raised
Pylint version
pylint 3.3.7
astroid 3.3.10
Python 3.10.12 (main, May 27 2025, 17:12:29) [GCC 11.4.0]
OS / Environment
Ubuntu 22
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementation