Skip to content

Commit dc12d19

Browse files
Fix incorrect statement about argparse.ArgumentParser.add_argument() (#145479)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
1 parent 15f6479 commit dc12d19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/argparse.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,9 +739,9 @@ By default, :mod:`!argparse` automatically handles the internal naming and
739739
display names of arguments, simplifying the process without requiring
740740
additional configuration.
741741
As such, you do not need to specify the dest_ and metavar_ parameters.
742-
The dest_ parameter defaults to the argument name with underscores ``_``
743-
replacing hyphens ``-`` . The metavar_ parameter defaults to the
744-
upper-cased name. For example::
742+
For optional arguments, the dest_ parameter defaults to the argument name, with
743+
underscores ``_`` replacing hyphens ``-``. The metavar_ parameter defaults to
744+
the upper-cased name. For example::
745745

746746
>>> parser = argparse.ArgumentParser(prog='PROG')
747747
>>> parser.add_argument('--foo-bar')

0 commit comments

Comments
 (0)