Skip to content
Merged
Changes from all 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
3 changes: 3 additions & 0 deletions Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,9 @@ is used when no command-line argument was present::
>>> parser.parse_args([])
Namespace(foo=42)

For required_ arguments, the ``default`` value is ignored. For example, this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside: we have a (somewhat unusual) convention of using italics for arguments instead of literal code formatting:

https://devguide.python.org/documentation/markup/

But I see we're using literals elsewhere in this file so it's best to be consistent.

applies to positional arguments with nargs_ values other than ``?`` or ``*``,
or optional arguments marked as ``required=True``.

Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if the
command-line argument was not present::
Expand Down
Loading