summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-10-28 12:25:58 (GMT)
committerGitHub <noreply@github.com>2022-10-28 12:25:58 (GMT)
commit2d4b6e00f0f3dd7da5e0f0dceb0dca5008060e1b (patch)
tree81391500049f212df7f1f09d3e6a2f272c01b069
parent725efe421974c5ce44b15c919adcfb2677a6e814 (diff)
downloadcpython-2d4b6e00f0f3dd7da5e0f0dceb0dca5008060e1b.zip
cpython-2d4b6e00f0f3dd7da5e0f0dceb0dca5008060e1b.tar.gz
cpython-2d4b6e00f0f3dd7da5e0f0dceb0dca5008060e1b.tar.bz2
`argparse` docs: normalize constant references (GH-98765)
(cherry picked from commit b27b57c6e44a276c8a9843fd37d4cf65b2827d5c) Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
-rw-r--r--Doc/library/argparse.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index 76efed9..bcbb38a 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -63,7 +63,7 @@ Name Description
action_ Specify how an argument should be handled ``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, ``'append_const'``, ``'count'``, ``'help'``, ``'version'``
choices_ Limit values to a specific set of choices ``['foo', 'bar']``, ``range(1, 10)``, or :class:`~collections.abc.Container` instance
const_ Store a constant value
-default_ Default value used when an argument is not provided Defaults to *None*
+default_ Default value used when an argument is not provided Defaults to ``None``
dest_ Specify the attribute name used in the result namespace
help_ Help message for an argument
metavar_ Alternate display name for the argument as shown in help
@@ -201,9 +201,10 @@ ArgumentParser objects
* usage_ - The string describing the program usage (default: generated from
arguments added to parser)
- * description_ - Text to display before the argument help (default: none)
+ * description_ - Text to display before the argument help
+ (by default, no text)
- * epilog_ - Text to display after the argument help (default: none)
+ * epilog_ - Text to display after the argument help (by default, no text)
* parents_ - A list of :class:`ArgumentParser` objects whose arguments should
also be included
@@ -1914,8 +1915,8 @@ FileType objects
Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, raw=<_io.FileIO name='raw.dat' mode='wb'>)
FileType objects understand the pseudo-argument ``'-'`` and automatically
- convert this into ``sys.stdin`` for readable :class:`FileType` objects and
- ``sys.stdout`` for writable :class:`FileType` objects::
+ convert this into :data:`sys.stdin` for readable :class:`FileType` objects and
+ :data:`sys.stdout` for writable :class:`FileType` objects::
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('infile', type=argparse.FileType('r'))