Skip to content

Commit ca45cd1

Browse files
committed
Minor updates
1 parent f6cb83c commit ca45cd1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Doc/library/string.templatelib.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,14 @@ Types
259259
:type: str
260260

261261
For interpolations created from t-string literals, :attr:`!expression`
262-
is the source text found inside the curly braces, including any
263-
whitespace, but excluding the curly braces themselves. For manually
264-
created interpolations, :attr:`!expression` is an arbitrary string.
265-
266-
It is recommended that developers manually creating
267-
:class:`!Interpolation` instances use valid Python expressions or leave
268-
the string empty, but this is not enforced.
262+
is the source text found inside the curly braces (``{`` & ``}``),
263+
including any whitespace, but excluding the curly braces themselves.
264+
For manually created interpolations, :attr:`!expression` is the arbitrary
265+
string provided when constructing the interpolation instance.
266+
267+
We recommend using valid Python expressions or the empty string for the
268+
``expression`` field of manually created :class:`!Interpolation`
269+
instances, although this is not enforced at runtime.
269270

270271
>>> t'{1 + 2}'.interpolations[0].expression
271272
'1 + 2'

0 commit comments

Comments
 (0)