]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-112527: Fix help text for required options in argparse (GH-112528)
authorFabian Henze <32638720+henzef@users.noreply.github.com>
Tue, 9 Dec 2025 16:48:35 +0000 (17:48 +0100)
committerGitHub <noreply@github.com>
Tue, 9 Dec 2025 16:48:35 +0000 (16:48 +0000)
commit1adb17b1a26e1547d14ca15f915e605cfdda3edd
treef9164d25bbab636fa90581403f9aaae0762643c4
parentb20722c300a78c38462081a3f1c45190b5434e71
gh-112527: Fix help text for required options in argparse (GH-112528)

For optional arguments with required=True, the ArgumentDefaultsHelpFormatter
would always add a " (default: None)" to the end of the help text.
Since that's a bit misleading, it is removed with this commit.
Lib/argparse.py
Lib/test/test_argparse.py
Misc/NEWS.d/next/Library/2025-12-09-14-40-45.gh-issue-112527.Tvf5Zk.rst [new file with mode: 0644]