gh-140448: Default suggest_on_error to True in argparse.ArgumentParser (#140450)

This commit is contained in:
Jakob 2025-10-22 18:15:26 +02:00 committed by GitHub
parent d51be28876
commit d2f3cfd384
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 36 additions and 26 deletions

View file

@ -1857,7 +1857,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
- exit_on_error -- Determines whether or not ArgumentParser exits with
error info when an error occurs
- suggest_on_error - Enables suggestions for mistyped argument choices
and subparser names (default: ``False``)
and subparser names (default: ``True``)
- color - Allow color output in help messages (default: ``False``)
"""
@ -1876,7 +1876,7 @@ def __init__(self,
allow_abbrev=True,
exit_on_error=True,
*,
suggest_on_error=False,
suggest_on_error=True,
color=True,
):
superinit = super(ArgumentParser, self).__init__