File tree Expand file tree Collapse file tree 3 files changed +27
-6
lines changed
Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -2673,9 +2673,9 @@ For example:
26732673 lead to a number of common errors (such as failing to display tuples and
26742674 dictionaries correctly). Using the newer :ref: `formatted string literals
26752675 <f-strings>`, the :meth: `str.format ` interface, or :ref: `template strings
2676- <template-strings>` may help avoid these errors. Each of these
2677- alternatives provides their own trade-offs and benefits of simplicity,
2678- flexibility, and/or extensibility.
2676+ ($-strings) <template-strings-pep292 >` may help avoid these errors.
2677+ Each of these alternatives provides their own trade-offs and benefits of
2678+ simplicity, flexibility, and/or extensibility.
26792679
26802680String objects have one unique built-in operation: the ``% `` operator (modulo).
26812681This is also known as the string *formatting * or *interpolation * operator.
Original file line number Diff line number Diff line change @@ -790,10 +790,20 @@ Nesting arguments and more complex examples::
790790
791791
792792
793- .. _template-strings :
793+ .. _template-strings-pep292 :
794794
795- Template strings
796- ----------------
795+ Template strings ($-strings)
796+ ----------------------------
797+
798+ .. note ::
799+
800+ The :class: `~string.Template ` class described here was introduced in Python
801+ 2.4. It is entirely unrelated to, and should *not * be confused with, the
802+ new :ref: `Template Strings <template-strings >` feature and
803+ :ref: `t-string literal syntax <t-strings >` introduced in Python 3.14 and
804+ originally described in :pep: `750 `. Python's t-string literals evaluate to
805+ instances of a different :class: `~string.templatelib.Template ` class, which
806+ is found in the :mod: `string.templatelib ` module.
797807
798808Template strings provide simpler string substitutions as described in
799809:pep: `292 `. A primary use case for template strings is for
Original file line number Diff line number Diff line change 1414 :ref: `Format strings <f-strings >`
1515
1616
17+
18+ .. _template-strings :
19+
20+ Template strings
21+ ----------------
22+
23+ Documentation forthcoming for PEP 750 template strings, also known as t-strings.
24+
25+ .. versionadded :: 3.14
26+
27+
1728.. _templatelib-template :
1829
1930Template
You can’t perform that action at this time.
0 commit comments