From 7dc55bd174c558081838401e0f37aa2aa268b4e0 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Sun, 5 Feb 2023 19:11:20 -0500 Subject: [PATCH 1/2] ArgumentDefaultsHelpFormatter: fix docstring Signed-off-by: FeRD (Frank Dana) --- Lib/argparse.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Lib/argparse.py b/Lib/argparse.py index 240625ff01084e..e53d4c2fa439d2 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -696,13 +696,10 @@ class ArgumentDefaultsHelpFormatter(HelpFormatter): """ def _get_help_string(self, action): - """ - Add the default value to the option help message. + """Add the default value to the option help message. - ArgumentDefaultsHelpFormatter and BooleanOptionalAction when it isn't - already present. This code will do that, detecting cornercases to - prevent duplicates or cases where it wouldn't make sense to the end - user. + Except when it's already present, or in cases where it wouldn't + make sense to the end user. """ help = action.help if help is None: From 1d799d23225f68aaa57ea8fbe326b841a154bc45 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Tue, 20 Feb 2024 19:01:31 -0500 Subject: [PATCH 2/2] Just remove docstring for private method --- Lib/argparse.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Lib/argparse.py b/Lib/argparse.py index 3b8a23a8ee7165..91241084d109e1 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -703,11 +703,6 @@ class ArgumentDefaultsHelpFormatter(HelpFormatter): """ def _get_help_string(self, action): - """Add the default value to the option help message. - - Except when it's already present, or in cases where it wouldn't - make sense to the end user. - """ help = action.help if help is None: help = ''