Skip to content

Commit 2e3d9d6

Browse files
PrinceNaroliyasavannahostrowski
authored andcommitted
pythongh-137988: Fix const description in argparse.add_argument() docs (pythonGH-138315)
(cherry picked from commit 37425fe) Co-authored-by: PrinceNaroliya <[email protected]> Co-authored-by: Savannah Bailey <[email protected]>
1 parent 9741cfc commit 2e3d9d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/argparse.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,8 +981,8 @@ the various :class:`ArgumentParser` actions. The two most common uses of it are
981981
(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional
982982
argument that can be followed by zero or one command-line arguments.
983983
When parsing the command line, if the option string is encountered with no
984-
command-line argument following it, the value of ``const`` will be assumed to
985-
be ``None`` instead. See the nargs_ description for examples.
984+
command-line argument following it, the value from ``const`` will be used.
985+
See the nargs_ description for examples.
986986

987987
.. versionchanged:: 3.11
988988
``const=None`` by default, including when ``action='append_const'`` or

0 commit comments

Comments
 (0)