From 3cf2eac2f23acbf21f4a5006a6ed2bd58371fdba Mon Sep 17 00:00:00 2001 From: Andrew Barnes Date: Thu, 5 Mar 2026 07:35:01 -0500 Subject: [PATCH 1/2] Doc: document add_argument() return value (Action object) --- Doc/library/argparse.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 8f31e815e0eb4b..5ff89d17689a60 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -698,6 +698,10 @@ The add_argument() method * deprecated_ - Whether or not use of the argument is deprecated. + The method returns the :class:`Action` object that was created and added to + the parser. This can be stored and used for further customization or + inspection. + The following sections describe how each of these are used. From 8e7b16e5e0c1374fd931e1a1f18f94ab492066b8 Mon Sep 17 00:00:00 2001 From: Andrew Barnes Date: Thu, 5 Mar 2026 19:31:12 -0500 Subject: [PATCH 2/2] docs: simplify to document return type only per review Co-Authored-By: Claude Opus 4.6 --- Doc/library/argparse.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 5ff89d17689a60..5a463ee9821d61 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -698,9 +698,7 @@ The add_argument() method * deprecated_ - Whether or not use of the argument is deprecated. - The method returns the :class:`Action` object that was created and added to - the parser. This can be stored and used for further customization or - inspection. + The method returns an :class:`Action` object representing the argument. The following sections describe how each of these are used.