Skip to content

argparse: make suggest_on_error a keyword-only parameter #133300

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

Closed
hugovk opened this issue May 2, 2025 · 0 comments
Closed

argparse: make suggest_on_error a keyword-only parameter #133300

hugovk opened this issue May 2, 2025 · 0 comments
Labels
type-feature A feature request or enhancement

Comments

@hugovk
Copy link
Member

hugovk commented May 2, 2025

Feature or enhancement

Proposal:

argparse.ArgumentParser() has a lot of parameters, suggest_on_error (added in 3.14) was its 15th.

https://docs.python.org/3.14/library/argparse.html#argparse.ArgumentParser

Many argparse CLIs I see already use keywords for most parameters, but I think we should make these new ones keyword-only, especially for new bools, as a long list of (..., True, False, True, ...) is best avoided.

Parameter number 16 color (added in 3.14) is keyword-only. I suggest we make suggest_on_error keyword-only as well.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant