Use `dataclasses` instead of `TypedDict` to handle defaults (but not
Open
enhancement
- Dominant language
- Python
- Stars
- 2k
- Forks
- 561
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 145
Description
This is related to https://github.com/NVIDIA-NeMo/RL/issues/1675, but outlines one way to start using dataclasses without losing the benefits of dictionaries.
We have gotten some feedback that it would be good to have a central place for the configs to inherit defaults when new configs are added. We can accomplish this by using dataclasses to essentially serve as the typedict, and then do a `merge(current_config, to_object(config_dataclass_with_defaults)`.
This avoids having to change too much of the code, while obtaining the default behavior.
Contributor guide
Assessment
This issue has not been assessed yet.