https://github.com/python/cpython/commit/2912fcc2e4675262bc44b200ceb513f01be311e1 commit: 2912fcc2e4675262bc44b200ceb513f01be311e1 branch: 3.14 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: savannahostrowski <savannahostrow...@gmail.com> date: 2025-05-30T13:24:08-07:00 summary:
[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 a4251411a97304ab001721c6231d86ddf4eac3f0) Co-authored-by: Savannah Bailey <savannahostrow...@gmail.com> files: M Doc/library/argparse.rst diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 29396c7a0366a1..17f126cc065a82 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -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. :: _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: arch...@mail-archive.com