Open
Description
Bug description
from dataclasses import InitVar
from dataclasses import dataclass
@dataclass
class Base:
x: int
def __post_init__(self):
self.x += 1
@dataclass
class Child(Base):
y: InitVar[int]
def __post_init__(self, y): # this is OK but it triggers `arguments-differ`
super().__post_init__()
self.x += y
Configuration
No response
Command used
pylint a.py
Pylint output
************* Module a
17:4: W0221: Number of parameters was 1 in 'Base.__post_init__' and is now 2 in overriding 'Child.__post_init__' method (arguments-differ)
Expected behavior
no warning should be reported
Pylint version
pylint 2.17.7
astroid 2.15.8
Python 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0]
OS / Environment
No response
Additional dependencies
No response