Clean up the calling interface of the Optintepreter#15966
Open
dcbaker wants to merge 2 commits into
Open
Conversation
0ebdae2 to
c00b72c
Compare
This reduces the amount of Any used, which allows mypy to provide better type checking.
c00b72c to
6255003
Compare
dnicolodi
reviewed
Jun 30, 2026
By putting the name and description parameters in the args tuple, we end up with a signature of `(self, args: list[TYPE_var], TYPE_dict)`, this matches up quite closely with other interfaces, and will make the future work of having a single calling convention much simpler.
6255003 to
8ea09d7
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The OptInterperter *_parser methods have a unique signature to them, passing some arguments in the
args: list[TYPE_var]parameter common to most calling interfaces, while also passing two string parameters separately. In the midst of cleaning that up, I noticed that there's several uses ofAnythat could be removed to make the typing tighter and thus mypy more helpful.This is peeled off of a larger body of work aimed at reworking our interpreter calling convention and state tracking.