Skip to content

Commit fbd30a5

Browse files
committed
doc(argparse): amend the description of action
1 parent b708956 commit fbd30a5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Doc/library/argparse.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,11 @@ how the command-line arguments should be handled. The supplied actions are:
839839
>>> parser.parse_args(['--version'])
840840
PROG 2.0
841841

842-
Only actions that consume command-line arguments (e.g. ``'store'``,
843-
``'append'`` or ``'extend'``) can be used with positional arguments. You may
844-
also specify an arbitrary action by passing an :class:`Action` subclass or
845-
other object that implements the same interface.
842+
You may also specify an arbitrary action by passing an :class:`Action` subclass
843+
(e.g. :class:`BooleanOptionalAction`) or other object that implements the same
844+
interface. Only actions that consume command-line arguments (e.g. ``'store'``,
845+
``'append'``, ``'extend'``, or custom actions with non-zero ``nargs``) can be used
846+
with positional arguments.
846847

847848
The recommended way to create a custom action is to extend :class:`Action`,
848849
overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` and

0 commit comments

Comments
 (0)