File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -259,13 +259,14 @@ Types
259
259
:type: str
260
260
261
261
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.
269
270
270
271
>>> t' {1 + 2}' .interpolations[0 ].expression
271
272
'1 + 2'
You can’t perform that action at this time.
0 commit comments