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
6 changes: 3 additions & 3 deletions Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,9 @@ By default, :mod:`!argparse` automatically handles the internal naming and
display names of arguments, simplifying the process without requiring
additional configuration.
As such, you do not need to specify the dest_ and metavar_ parameters.
The dest_ parameter defaults to the argument name with underscores ``_``
replacing hyphens ``-`` . The metavar_ parameter defaults to the
upper-cased name. For example::
For optional arguments, the dest_ parameter defaults to the argument name, with
underscores ``_`` replacing hyphens ``-``. The metavar_ parameter defaults to
the upper-cased name. For example::

>>> parser = argparse.ArgumentParser(prog='PROG')
>>> parser.add_argument('--foo-bar')
Expand Down
Loading