[3.14] GH-106235: Clarify parse_known_args documentation by removing "remaining" (GH-126921) (#134913)

GH-106235: Clarify `parse_known_args` documentation by removing "remaining" (GH-126921)
(cherry picked from commit a4251411a9)

Co-authored-by: Savannah Bailey <savannahostrowski@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-05-30 22:24:08 +02:00 committed by GitHub
parent 32574d4bc0
commit 2912fcc2e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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