@@ -289,9 +289,9 @@ Literals
289289 * ``conversion `` is an integer:
290290
291291 * -1: no formatting
292- * 115 (``ord('s ') ``): `` !s `` string formatting
293- * 114 (`` ord('r') ``): `` !r `` repr formatting
294- * 97 (``ord('a ') ``): `` !a `` ASCII formatting
292+ * 97: `` !a `` :func: ` ASCII <ascii> ` formatting (``ord('a ') ``)
293+ * 114: `` !r `` :func: ` repr ` formatting (`` ord('r') ``)
294+ * 115: `` !s `` :func: ` string <str> ` formatting (``ord('s ') ``)
295295
296296 * ``format_spec `` is a :class: `JoinedStr ` node representing the formatting
297297 of the value, or ``None `` if no format was specified. Both
@@ -325,14 +325,18 @@ Literals
325325 Constant(value='.3')]))]))
326326
327327
328- .. class :: TemplateStr(values)
328+ .. class :: TemplateStr(values, / )
329329
330- A t-string, comprising a series of :class: `Interpolation ` and :class: `Constant `
331- nodes.
330+ .. versionadded :: 3.14
331+
332+ Node representing a template string literal, comprising a series of
333+ :class: `Interpolation ` and :class: `Constant ` nodes.
334+ These nodes may be any order, and do not need to be interleaved.
332335
333336 .. doctest ::
334337
335- >>> print (ast.dump(ast.parse(' t"{name} finished {place: ordinal} "' , mode = ' eval' ), indent = 4 ))
338+ >>> expr = ast.parse(' t"{name} finished {place: ordinal} "' , mode = ' eval' )
339+ >>> print (ast.dump(expr, indent = 4 ))
336340 Expression(
337341 body=TemplateStr(
338342 values=[
@@ -349,29 +353,26 @@ Literals
349353 values=[
350354 Constant(value='ordinal')]))]))
351355
352- .. versionadded :: 3.14
353-
356+ .. class :: Interpolation(value, str, conversion, format_spec=None)
354357
355- .. class :: Interpolation(value, str, conversion, format_spec)
358+ .. versionadded :: 3.14
356359
357- Node representing a single interpolation field in a t- string.
360+ Node representing a single interpolation field in a template string literal .
358361
359362 * ``value `` is any expression node (such as a literal, a variable, or a
360363 function call).
361364 * ``str `` is a constant containing the text of the interpolation expression.
362365 * ``conversion `` is an integer:
363366
364367 * -1: no conversion
365- * 115 : ``!s `` string conversion
366- * 114: ``!r `` repr conversion
367- * 97 : ``!a `` ascii conversion
368+ * 97 : ``!a `` :func: ` ASCII <ascii> ` conversion (`` ord('a') ``)
369+ * 114: ``!r `` :func: ` repr ` conversion (`` ord('r') ``)
370+ * 115 : ``!s `` :func: ` string <str> ` conversion (`` ord('s') ``)
368371
369372 * ``format_spec `` is a :class: `JoinedStr ` node representing the formatting
370373 of the value, or ``None `` if no format was specified. Both
371374 ``conversion `` and ``format_spec `` can be set at the same time.
372375
373- .. versionadded :: 3.14
374-
375376
376377.. class :: List(elts, ctx)
377378 Tuple(elts, ctx)
0 commit comments