summaryrefslogtreecommitdiff
path: root/Doc/library/string.rst
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-02-21 12:30:32 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2013-02-21 12:30:32 +0200
commitbcbc5678d55b62c695479d2f57e0c31c81b8eca7 (patch)
tree4272c932dffad78091f4c6bf1d944f42b94a0ceb /Doc/library/string.rst
parentb3d62cefc781c396754f93c98e837fb073755333 (diff)
downloadcpython-git-bcbc5678d55b62c695479d2f57e0c31c81b8eca7.tar.gz
#17265: fix highlight in template example. Initial patch by Berker Peksag.
Diffstat (limited to 'Doc/library/string.rst')
-rw-r--r--Doc/library/string.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 5778980fee..81a01fde50 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -688,7 +688,7 @@ these rules. The methods of :class:`Template` are:
This is the object passed to the constructor's *template* argument. In
general, you shouldn't change it, but read-only access is not enforced.
-Here is an example of how to use a Template:
+Here is an example of how to use a Template::
>>> from string import Template
>>> s = Template('$who likes $what')
@@ -697,11 +697,11 @@ Here is an example of how to use a Template:
>>> d = dict(who='tim')
>>> Template('Give $who $100').substitute(d)
Traceback (most recent call last):
- [...]
+ ...
ValueError: Invalid placeholder in string: line 1, col 11
>>> Template('$who likes $what').substitute(d)
Traceback (most recent call last):
- [...]
+ ...
KeyError: 'what'
>>> Template('$who likes $what').safe_substitute(d)
'tim likes $what'