]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-106235: Clarify `parse_known_args` documentation by removing "remaining" (#126921)
authorSavannah Bailey <savannahostrowski@gmail.com>
Fri, 30 May 2025 03:34:34 +0000 (20:34 -0700)
committerGitHub <noreply@github.com>
Fri, 30 May 2025 03:34:34 +0000 (20:34 -0700)
Doc/library/argparse.rst

index 29396c7a0366a1168345dd28ed5676b97b58b1a1..17f126cc065a8256bb1fc8522b385abd6667a907 100644 (file)
@@ -2122,12 +2122,15 @@ Partial parsing
 
 .. method:: ArgumentParser.parse_known_args(args=None, namespace=None)
 
-   Sometimes a script may only parse a few of the command-line arguments, passing
-   the remaining arguments on to another script or program. In these cases, the
-   :meth:`~ArgumentParser.parse_known_args` method can be useful.  It works much like
-   :meth:`~ArgumentParser.parse_args` except that it does not produce an error when
-   extra arguments are present.  Instead, it returns a two item tuple containing
-   the populated namespace and the list of remaining argument strings.
+   Sometimes a script only needs to handle a specific set of command-line
+   arguments, leaving any unrecognized arguments for another script or program.
+   In these cases, the :meth:`~ArgumentParser.parse_known_args` method can be
+   useful.
+
+   This method works similarly to :meth:`~ArgumentParser.parse_args`, but it does
+   not raise an error for extra, unrecognized arguments. Instead, it parses the
+   known arguments and returns a two item tuple that contains the populated
+   namespace and the list of any unrecognized arguments.
 
    ::