Skip to content

Default suggest_on_error to True in argparse.ArgumentParser #140448

Description

@HomerusJa

Feature or enhancement

Proposal:

Change the default value of the suggest_on_error parameter in argparse.ArgumentParser from False to True.

This improves the UX of the argparse module by making helpful error suggestions the default behavior.

While this is technically a breaking change, the impact is negligible as it only affects error messages (which already indicate failure). Users who prefer the old behavior can explicitly set suggest_on_error=False.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

This feature has been suggested in a Bluesky thread, where it has been suggested by @savannahostrowski and @hugovk.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions