Open
Description
from dataclasses import dataclass, InitVar, KW_ONLY
@dataclass
class A:
_: KW_ONLY
x: InitVar[int]
def __post_init__(self, x: int) -> None:
pass
@dataclass
class C(A):
y: InitVar[str]
def __post_init__(self, x: int, y: str) -> None: # Correct order.
super().__post_init__(x)
gives
a.py:19: error: Argument 2 of "__post_init__" is incompatible with supertype "dataclass"; supertype defines the argument type as "str" [override]
def __post_init__(self, x: int, y: str) -> None:
^~~~~~
a.py:19: error: Argument 3 of "__post_init__" is incompatible with supertype "dataclass"; supertype defines the argument type as "int" [override]
def __post_init__(self, x: int, y: str) -> None: