Skip to content

Commit 46c1b9c

Browse files
bpo-17050: Remove documentation on argparse.REMAINDER (GH-18661) (GH-20363)
1 parent 4bb4cde commit 46c1b9c

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

Doc/library/argparse.rst

-13
Original file line numberDiff line numberDiff line change
@@ -961,19 +961,6 @@ values are:
961961
usage: PROG [-h] foo [foo ...]
962962
PROG: error: the following arguments are required: foo
963963

964-
.. _`argparse.REMAINDER`:
965-
966-
* ``argparse.REMAINDER``. All the remaining command-line arguments are gathered
967-
into a list. This is commonly useful for command line utilities that dispatch
968-
to other command line utilities::
969-
970-
>>> parser = argparse.ArgumentParser(prog='PROG')
971-
>>> parser.add_argument('--foo')
972-
>>> parser.add_argument('command')
973-
>>> parser.add_argument('args', nargs=argparse.REMAINDER)
974-
>>> print(parser.parse_args('--foo B cmd --arg1 XX ZZ'.split()))
975-
Namespace(args=['--arg1', 'XX', 'ZZ'], command='cmd', foo='B')
976-
977964
If the ``nargs`` keyword argument is not provided, the number of arguments consumed
978965
is determined by the action_. Generally this means a single command-line argument
979966
will be consumed and a single item (not a list) will be produced.

0 commit comments

Comments
 (0)