Skip to content

Use dataclasses instead of TypedDict to handle defaults (but not #2102

Open

Description

@terrykong

This is related to #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.

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions