You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Doc/library/string.templatelib.rst
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,9 @@
19
19
Template
20
20
--------
21
21
22
-
The :class:`Template` class describes the contents of a template string.
22
+
The :class:`!Template` class describes the contents of a template string.
23
23
24
-
The most common way to create a new :class:`Template` instance is to use the t-string literal syntax. This syntax is identical to that of :ref:`f-strings`, except that the string is prefixed with a ``t`` instead of an ``f``. For example, the following code creates a :class:`Template` that can be used to format strings:
24
+
The most common way to create a new :class:`!Template` instance is to use the t-string literal syntax. This syntax is identical to that of :ref:`f-strings`, except that the string is prefixed with a ``t`` instead of an ``f``. For example, the following code creates a :class:`Template` that can be used to format strings:
25
25
26
26
>>> name ="World"
27
27
>>> greeting = t"Hello {name}!"
@@ -30,7 +30,7 @@ The most common way to create a new :class:`Template` instance is to use the t-s
It is also possible to create a :class:`Template` directly, using its constructor. This takes an arbitrary collection of strings and :class:`Interpolation` instances:
33
+
It is also possible to create a :class:`!Template` directly, using its constructor. This takes an arbitrary collection of strings and :class:`Interpolation` instances:
34
34
35
35
>>> from string.templatelib import Interpolation, Template
36
36
>>> name ="World"
@@ -40,7 +40,7 @@ It is also possible to create a :class:`Template` directly, using its constructo
40
40
41
41
.. class:: Template(*args)
42
42
43
-
Create a new :class:`Template` object.
43
+
Create a new :class:`!Template` object.
44
44
45
45
:param args: A mix of strings and :class:`Interpolation` instances in any order.
46
46
:type args: str | Interpolation
@@ -112,7 +112,7 @@ It is also possible to create a :class:`Template` directly, using its constructo
112
112
113
113
.. class:: Interpolation(*args)
114
114
115
-
Create a new :class:`Interpolation` object.
115
+
Create a new :class:`!Interpolation` object.
116
116
117
117
:param value: The evaluated, in-scope result of the interpolation.
118
118
:type value: object
@@ -126,7 +126,7 @@ It is also possible to create a :class:`Template` directly, using its constructo
126
126
:param format_spec: An optional, arbitrary string used as the :ref:`format specification <formatspec>` to present the value.
127
127
:type expression: str = ""
128
128
129
-
The :class:`Interpolation` type represents an expression inside a template string. It is shallow immutable -- its attributes cannot be reassigned.
129
+
The :class:`!Interpolation` type represents an expression inside a template string. It is shallow immutable -- its attributes cannot be reassigned.
0 commit comments