Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ Sub-commands
stored; by default ``None`` and no value is stored

* required_ - Whether or not a subcommand must be provided, by default
``False``.
``False``. (added in 3.7)
Comment thread
adamjstewart marked this conversation as resolved.
Outdated

* help_ - help for sub-parser group in help output, by default ``None``

Expand Down Expand Up @@ -1792,6 +1792,9 @@ Sub-commands
>>> parser.parse_args(['2', 'frobble'])
Namespace(subparser_name='2', y='frobble')

.. versionadded:: 3.7
Comment thread
adamjstewart marked this conversation as resolved.
Outdated
The *required* keyword argument.


FileType objects
^^^^^^^^^^^^^^^^
Expand Down
4 changes: 4 additions & 0 deletions Doc/whatsnew/3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2401,6 +2401,10 @@ Changes in the Python API
instead of a :class:`bytes` instance.
(Contributed by Victor Stinner in :issue:`21071`.)

* :meth:`ArgumentParser.add_subparsers() <argparse.ArgumentParser.add_subparsers>`
has a new ``required`` parameter that defaults to ``False``.
Comment thread
adamjstewart marked this conversation as resolved.
Outdated
(Contributed by Anthony Sottile in :issue:`26510`.)

* :meth:`ast.literal_eval()` is now stricter. Addition and subtraction of
arbitrary numbers are no longer allowed.
(Contributed by Serhiy Storchaka in :issue:`31778`.)
Expand Down