From: Savannah Ostrowski Date: Tue, 14 Apr 2026 17:53:11 +0000 (-0700) Subject: [3.13] gh-72406: Document argument ordering in argparse help output (GH-148534) ... X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=ee34f95dbceefb1e0bc2510dd9778bb83e9e1e8d;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-72406: Document argument ordering in argparse help output (GH-148534) (#148567) gh-72406: Document argument ordering in argparse help output (#148534) (cherry picked from commit 4286227308ee8dafc867062df4cad73af2a84696) Co-authored-by: Santi Hernandez --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index af3972417094..89b9faf9f60d 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.