-
-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use OptionInfo type for option registration args/kwargs. (#21766)
The options registration system has for a long time passed around the naked args and kwargs used at registration time. However the more recent implementation of class field-based declarative options introduced an `OptionsInfo` dataclass to encapsulate that data. This PR spreads the use of `OptionsInfo` into the options registration code. Advantages include: - More succinct code. - Proper type annotations. - No confusion about when to use `*` or `**`. Note that this change renames `OptionsInfo` to `OptionInfo`, since it represents the registration of a single option. It also renames its fields to `args` and `kwargs`, since that is the usage in most of the related code. Also, the name `flag_options` was doubly confusing: A) A flag is just one aspect of an option, and B) "options" is overloaded. This refers the knobs you can set when registering an option, so using the word "options" for it is brain-hurting. I considered "knobs", but figured "kwargs" was just as good, and already in use.
- Loading branch information
Showing
12 changed files
with
115 additions
and
112 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
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
Oops, something went wrong.