Skip to content

Commit 2d4b6e0

Browse files
argparse docs: normalize constant references (GH-98765)
(cherry picked from commit b27b57c) Co-authored-by: Skip Montanaro <[email protected]>
1 parent 725efe4 commit 2d4b6e0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Doc/library/argparse.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Name Description
6363
action_ Specify how an argument should be handled ``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, ``'append_const'``, ``'count'``, ``'help'``, ``'version'``
6464
choices_ Limit values to a specific set of choices ``['foo', 'bar']``, ``range(1, 10)``, or :class:`~collections.abc.Container` instance
6565
const_ Store a constant value
66-
default_ Default value used when an argument is not provided Defaults to *None*
66+
default_ Default value used when an argument is not provided Defaults to ``None``
6767
dest_ Specify the attribute name used in the result namespace
6868
help_ Help message for an argument
6969
metavar_ Alternate display name for the argument as shown in help
@@ -201,9 +201,10 @@ ArgumentParser objects
201201
* usage_ - The string describing the program usage (default: generated from
202202
arguments added to parser)
203203

204-
* description_ - Text to display before the argument help (default: none)
204+
* description_ - Text to display before the argument help
205+
(by default, no text)
205206

206-
* epilog_ - Text to display after the argument help (default: none)
207+
* epilog_ - Text to display after the argument help (by default, no text)
207208

208209
* parents_ - A list of :class:`ArgumentParser` objects whose arguments should
209210
also be included
@@ -1914,8 +1915,8 @@ FileType objects
19141915
Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, raw=<_io.FileIO name='raw.dat' mode='wb'>)
19151916

19161917
FileType objects understand the pseudo-argument ``'-'`` and automatically
1917-
convert this into ``sys.stdin`` for readable :class:`FileType` objects and
1918-
``sys.stdout`` for writable :class:`FileType` objects::
1918+
convert this into :data:`sys.stdin` for readable :class:`FileType` objects and
1919+
:data:`sys.stdout` for writable :class:`FileType` objects::
19191920

19201921
>>> parser = argparse.ArgumentParser()
19211922
>>> parser.add_argument('infile', type=argparse.FileType('r'))

0 commit comments

Comments
 (0)