bpo-17050: Remove documentation on argparse.REMAINDER (GH-18661) (GH-20363)

This commit is contained in:
Miss Islington (bot) 2020-05-24 14:31:17 -07:00 committed by GitHub
parent 4bb4cde177
commit 46c1b9c7b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 13 deletions

View File

@ -961,19 +961,6 @@ values are:
usage: PROG [-h] foo [foo ...] usage: PROG [-h] foo [foo ...]
PROG: error: the following arguments are required: foo PROG: error: the following arguments are required: foo
.. _`argparse.REMAINDER`:
* ``argparse.REMAINDER``. All the remaining command-line arguments are gathered
into a list. This is commonly useful for command line utilities that dispatch
to other command line utilities::
>>> parser = argparse.ArgumentParser(prog='PROG')
>>> parser.add_argument('--foo')
>>> parser.add_argument('command')
>>> parser.add_argument('args', nargs=argparse.REMAINDER)
>>> print(parser.parse_args('--foo B cmd --arg1 XX ZZ'.split()))
Namespace(args=['--arg1', 'XX', 'ZZ'], command='cmd', foo='B')
If the ``nargs`` keyword argument is not provided, the number of arguments consumed If the ``nargs`` keyword argument is not provided, the number of arguments consumed
is determined by the action_. Generally this means a single command-line argument is determined by the action_. Generally this means a single command-line argument
will be consumed and a single item (not a list) will be produced. will be consumed and a single item (not a list) will be produced.