Skip to content

Commit b4912b8

Browse files
committed
Issue #25314: Remove confused statement about const argument
1 parent d82da9f commit b4912b8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/argparse.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,7 @@ how the command-line arguments should be handled. The supplied actions are:
720720
Namespace(foo='1')
721721

722722
* ``'store_const'`` - This stores the value specified by the const_ keyword
723-
argument. (Note that the const_ keyword argument defaults to the rather
724-
unhelpful ``None``.) The ``'store_const'`` action is most commonly used with
723+
argument. The ``'store_const'`` action is most commonly used with
725724
optional arguments that specify some sort of flag. For example::
726725

727726
>>> parser = argparse.ArgumentParser()
@@ -923,7 +922,8 @@ the various :class:`ArgumentParser` actions. The two most common uses of it are
923922
command-line argument following it, the value of ``const`` will be assumed instead.
924923
See the nargs_ description for examples.
925924

926-
The ``const`` keyword argument defaults to ``None``.
925+
With the ``'store_const'`` and ``'append_const'`` actions, the ``const``
926+
keyword argument must be given. For other actions, is defaults to ``None``.
927927

928928

929929
default

0 commit comments

Comments
 (0)