diff --git a/paramdb/_param_data/_dataclasses.py b/paramdb/_param_data/_dataclasses.py index f352889..58bdc0e 100644 --- a/paramdb/_param_data/_dataclasses.py +++ b/paramdb/_param_data/_dataclasses.py @@ -13,10 +13,11 @@ class _ParamDataclass(ParamData): """Base class for parameter dataclasses.""" - def __init_subclass__(cls, /, kw_only=True, **kwargs: Any) -> None: + def __init_subclass__(cls, /, kw_only: bool = True, **kwargs: Any) -> None: # Convert subclasses into dataclasses super().__init_subclass__() - dataclass(cls, kw_only=kw_only, **kwargs) + dataclass(kw_only=kw_only, **kwargs)(cls) + dataclass_transform(kw_only_default=True)(cls) def __getitem__(self, name: str) -> Any: # Enable getting attributes via indexing