-
Notifications
You must be signed in to change notification settings - Fork 133
Closed
astral-sh/ruff
#19986Labels
bugSomething isn't workingSomething isn't workingdataclassesIssues relating to dataclasses and dataclass_transformIssues relating to dataclasses and dataclass_transform
Description
In this example:
from dataclasses import dataclass, KW_ONLY
@dataclass
class D:
x: int
_: KW_ONLY
y: str
@dataclass
class E(D):
z: bytes
E(1, b"foo", y="foo")The field z should not be considered keyword-only; the _: KW_ONLY in D applies only to y, not to z in the subclass.
We currently handle KW_ONLY when we synthesize the __init__ member; I think we maybe need to handle it in own_fields instead?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdataclassesIssues relating to dataclasses and dataclass_transformIssues relating to dataclasses and dataclass_transform