-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pythonic config] properly propagate default values set at the top le…
…vel for nested config classes (#27206) ## Summary Ensures that default values on Pythonic Config get properly propagated to inner Config classes, e.g. ```python class ANestedOpConfig(Config): an_int: int = 1 a_bool: bool = True class AnOpConfig(Config): a_string: str = "foo" a_nested: ANestedOpConfig = ANestedOpConfig(an_int=5) ``` An alternative impl which uses some utils in a stacked PR can be found at #27209. ## Test Plan New unit test; todo add a few more
- Loading branch information
Showing
3 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters