From 7d4ea577818659234e31007529e32934211eb4a0 Mon Sep 17 00:00:00 2001 From: Santi Hernandez Date: Tue, 14 Apr 2026 10:24:16 -0600 Subject: [PATCH] gh-72406: Document argument ordering in argparse help output (#148534) Co-authored-by: Savannah Ostrowski (cherry picked from commit 4286227308ee8dafc867062df4cad73af2a84696) --- Doc/library/argparse.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index af39724170941d..89b9faf9f60d2a 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1888,6 +1888,9 @@ Argument groups Note that any arguments not in your user-defined groups will end up back in the usual "positional arguments" and "optional arguments" sections. + Within each argument group, arguments are displayed in help output in the + order in which they are added. + .. versionchanged:: 3.11 Calling :meth:`add_argument_group` on an argument group is deprecated. This feature was never supported and does not always work correctly.