diff options
author | Julien Palard <julien@palard.fr> | 2022-03-23 08:35:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 08:35:33 (GMT) |
commit | 3ac4e783e077ffd7b51c6acc1591002974644051 (patch) | |
tree | 1f643731ed4f93ef0f3d873fbc1779e5e0f64e6e /Doc | |
parent | ec8906fb5930b1f078e2a2170cdf445e6c6faf57 (diff) | |
download | cpython-3ac4e783e077ffd7b51c6acc1591002974644051.zip cpython-3ac4e783e077ffd7b51c6acc1591002974644051.tar.gz cpython-3ac4e783e077ffd7b51c6acc1591002974644051.tar.bz2 |
[doc] configparser: avoid inline comments. (GH-31247)
People are testing those blocs with the default
inline_comment_prefixes of None, leading to a:
configparser.InterpolationSyntaxError: '$' must be followed by '$' or '{', found: '$ sign ($ is the only character that needs to be escaped)'
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/configparser.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 323dd2a..72aa20d 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -347,7 +347,8 @@ from ``get()`` calls. my_pictures: %(my_dir)s/Pictures [Escape] - gain: 80%% # use a %% to escape the % sign (% is the only character that needs to be escaped) + # use a %% to escape the % sign (% is the only character that needs to be escaped): + gain: 80%% In the example above, :class:`ConfigParser` with *interpolation* set to ``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of @@ -382,7 +383,8 @@ from ``get()`` calls. my_pictures: ${my_dir}/Pictures [Escape] - cost: $$80 # use a $$ to escape the $ sign ($ is the only character that needs to be escaped) + # use a $$ to escape the $ sign ($ is the only character that needs to be escaped): + cost: $$80 Values from other sections can be fetched as well: |