1. Larry Hastings
  2. python-clinic


Ezio Melotti  committed 943ea41

#17265: fix highlight in template example. Initial patch by Berker Peksag.

  • Participants
  • Parent commits 479bc80
  • Branches 2.7

Comments (0)

Files changed (1)

File Doc/library/string.rst

View file
  • Ignore whitespace
       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')
    >>> 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'