Describe the bug
Subclassed dataclasses incorrectly show the following type error when the parent dataclass contains a field with init=False.
Data class fields without default value cannot appear after data fields with default values
To Reproduce
from dataclasses import dataclass, field
@dataclass
class Parent:
prop_one: str = field(init=False)
def __post_init__(self):
self.prop_one = "test"
@dataclass
class Child(Parent):
prop_two: str # <- pyright shows a "default value" type error here
test = Child(prop_two="test")
assert test.prop_one == "test"
assert test.prop_two == "test"
Expected behavior
prop_two on the Child class should not display a type error since prop_one does not contain a default value.
Screenshots or Code

VS Code extension or command-line
Thanks for the bug report. This will be fixed in the next version of Pyright.
This is now fixed in version 1.1.45, which I just published.