Skip to content

Commit fcd74e6

Browse files
committed
Fix lint issues
1 parent 00a535d commit fcd74e6

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Doc/library/string.templatelib.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
Template
2020
--------
2121

22-
The :class:`Template` class describes the contents of a template string.
22+
The :class:`!Template` class describes the contents of a template string.
2323

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:
2525

2626
>>> name = "World"
2727
>>> 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
3030
>>> print(list(greeting))
3131
['Hello ', Interpolation('World', 'name', None, ''), '!']
3232

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:
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:
3434

3535
>>> from string.templatelib import Interpolation, Template
3636
>>> name = "World"
@@ -40,7 +40,7 @@ It is also possible to create a :class:`Template` directly, using its constructo
4040

4141
.. class:: Template(*args)
4242

43-
Create a new :class:`Template` object.
43+
Create a new :class:`!Template` object.
4444

4545
:param args: A mix of strings and :class:`Interpolation` instances in any order.
4646
:type args: str | Interpolation
@@ -112,7 +112,7 @@ It is also possible to create a :class:`Template` directly, using its constructo
112112

113113
.. class:: Interpolation(*args)
114114

115-
Create a new :class:`Interpolation` object.
115+
Create a new :class:`!Interpolation` object.
116116

117117
:param value: The evaluated, in-scope result of the interpolation.
118118
:type value: object
@@ -126,7 +126,7 @@ It is also possible to create a :class:`Template` directly, using its constructo
126126
:param format_spec: An optional, arbitrary string used as the :ref:`format specification <formatspec>` to present the value.
127127
:type expression: str = ""
128128

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.
130130

131131
>>> name = "World"
132132
>>> template = t"Hello {name}"

Doc/reference/lexical_analysis.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -926,15 +926,16 @@ that is prefixed with ``'t'`` or ``'T'``. These strings follow the same
926926
syntax and evaluation rules as `formatted string literals <f-strings>`_, with
927927
the following differences:
928928

929-
- Rather than evaluating to a `str` object, t-strings evaluate to a
930-
`Template` object from the :mod:`string.templatelib` module.
929+
- Rather than evaluating to a ``str`` object, t-strings evaluate to a
930+
:class:`~string.templatelib.Template` object from the
931+
:mod:`string.templatelib` module.
931932

932933
- Evaluated expressions are *not* formatted using the
933934
:func:`format` protocol; :meth:`~object.__format__` is *not* invoked. Instead,
934-
the expressions are evaluated and a new `Interpolation` object (also from the
935-
:mod:`string.templatelib` module) is created, which contains the evaluated
936-
value of the expression. That `Interpolation` object is found in the containing
937-
`Template`.
935+
the expressions are evaluated and a new :class:`~string.templatelib.Interpolation``
936+
object (also from the :mod:`string.templatelib` module) is created, which
937+
contains the evaluated value of the expression. That ``Interpolation`` object
938+
is found in the containing ``Template``.
938939

939940

940941

0 commit comments

Comments
 (0)