Skip to content

Commit d8904b6

Browse files
committed
Correct the Interpolation() calls.
1 parent ec44c2b commit d8904b6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/string.templatelib.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ It is also possible to create a :class:`Template` directly, using its constructo
3434

3535
>>> from string.templatelib import Interpolation, Template
3636
>>> name = "World"
37-
>>> greeting = Template("Hello, ", Interpolation(name), "!")
37+
>>> greeting = Template("Hello, ", Interpolation(name, "name"), "!")
3838
>>> print(list(greeting))
3939
['Hello, ', Interpolation('World'), '!']
4040

@@ -55,9 +55,9 @@ It is also possible to create a :class:`Template` directly, using its constructo
5555
If two or more consecutive interpolations are passed, they will be treated as separate interpolations and an empty string will be inserted between them. For example, the following code creates a template with a single value in the :attr:`~Template.strings` attribute:
5656

5757
>>> from string.templatelib import Interpolation, Template
58-
>>> greeting = Template(Interpolation("World"), Interpolation("!"))
58+
>>> greeting = Template(Interpolation("World", "name"), Interpolation("!", "punctuation"))
5959
>>> print(greeting.strings)
60-
('',)
60+
('', '', '')
6161

6262
.. attribute:: strings
6363

0 commit comments

Comments
 (0)