Skip to content

argparse: type subparser helper's add_parser #8558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 19, 2022

Conversation

DMRobertson
Copy link
Contributor

A drive-by. I grepped for TODO and this one seemed easy enough.

A drive-by. I grepped for TODO and this one seemed easy enough.
@DMRobertson DMRobertson force-pushed the dmr/argparse-subparser-add-parser branch from ee3b3af to cb05183 Compare August 18, 2022 18:44
@DMRobertson
Copy link
Contributor Author

Oh. Stubtest isn't happy because the actual method takes **kwargs. I don't think there's a way to express "this function uses the kwargs of another one" in this case, even with ParamSpec?

@github-actions

This comment has been minimized.

@Akuli
Copy link
Collaborator

Akuli commented Aug 18, 2022

You're right: there's no good way to say "same parameters as this other method" apart from aliasing the methods to each other, as in alias = original_method in the class body.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@DMRobertson DMRobertson marked this pull request as ready for review August 19, 2022 14:31
Copy link
Collaborator

@Akuli Akuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I like how there's a comment in both places that must stay in sync :)

@Akuli Akuli merged commit 0428069 into python:master Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants