Open moskomule opened 1 year ago
As child config classes need to be at the top of the parent class, the implementation of add_dataclass_arguments https://github.com/moskomule/chika/blob/e455aab749752054c5868f78cfb8d7708298af2f/chika/chika.py#L54 and parse_args_into_dataclass https://github.com/moskomule/chika/blob/e455aab749752054c5868f78cfb8d7708298af2f/chika/chika.py#L133 can be simpler and easier to maintain.
add_dataclass_arguments
parse_args_into_dataclass
@chika.config class ChildConfig: ... @chika.config class ParentConfig: child: ChildConfig # always at the top! others: tuple[str, str] = ('hello', 'world')
As child config classes need to be at the top of the parent class, the implementation of
add_dataclass_arguments
https://github.com/moskomule/chika/blob/e455aab749752054c5868f78cfb8d7708298af2f/chika/chika.py#L54 andparse_args_into_dataclass
https://github.com/moskomule/chika/blob/e455aab749752054c5868f78cfb8d7708298af2f/chika/chika.py#L133 can be simpler and easier to maintain.