-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
pylint-dev/astroid
#1899Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codedataclasses
Description
Bug description
this issue seems to be close to #5767, but for inherited dataclasses:
@dataclass
class Parent:
p1: int = field(kw_only=True, default=0)
@dataclass
class Child(Parent):
c1: str
Child('')
Child('', p1=1) # redundant-keyword-arg" : "Argument 'p1' passed by position and keyword in constructor call"
Child(c1='') # "unexpected-keyword-arg": "Unexpected keyword argument 'c1' in constructor call"
Child(c1='', p1=5) # "unexpected-keyword-arg": "Unexpected keyword argument 'c1' in constructor call"Configuration
No response
Command used
pylint a.pyPylint output
[{
"code": "redundant-keyword-arg",
"message": "Argument 'p1' passed by position and keyword in constructor call",
},{
"code": "unexpected-keyword-arg",
"message": "Unexpected keyword argument 'c1' in constructor call",
},{
"code": "unexpected-keyword-arg",
"message": "Unexpected keyword argument 'c1' in constructor call",
}]Expected behavior
no errors
Pylint version
pylint 2.15.4
astroid 2.12.11
Python 3.10.0 (v3.10.0:b494f5935c, Oct 4 2021, 14:59:20) [Clang 12.0.5 (clang-1205.0.22.11)]OS / Environment
No response
Additional dependencies
No response
EduardoTT and babichjacobmichael-k
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 codedataclasses