@@ -109,14 +109,14 @@ Template String Literals
109109------------------------
110110
111111This PEP introduces a new string prefix, ``t ``, to define template string literals.
112- These literals resolve to a new type, ``Template ``, found in a new top-level
113- standard library module, ``templatelib ``.
112+ These literals resolve to a new type, ``Template ``, found in the standard library
113+ module ``<<TBD>> ``.
114114
115115The following code creates a ``Template `` instance:
116116
117117.. code-block :: python
118118
119- from templatelib import Template
119+ from TBD import Template
120120 template = t" This is a template string."
121121 assert isinstance (template, Template)
122122
@@ -135,7 +135,7 @@ see the `Raw Template Strings`_ section below for more information.
135135The ``Template `` Type
136136---------------------
137137
138- Template strings evaluate to an instance of a new type, ``templatelib .Template ``:
138+ Template strings evaluate to an instance of a new type, ``<<TBD>> .Template ``:
139139
140140.. code-block :: python
141141
@@ -200,7 +200,7 @@ The ``Interpolation`` Type
200200--------------------------
201201
202202The ``Interpolation `` type represents an expression inside a template string.
203- Like ``Template ``, it is a new class found in the ``templatelib `` module:
203+ Like ``Template ``, it is a new class found in the ``<<TBD>> `` module:
204204
205205.. code-block :: python
206206
@@ -318,7 +318,7 @@ interpolations in uppercase:
318318
319319.. code-block :: python
320320
321- from templatelib import Template, Interpolation
321+ from TBD import Template, Interpolation
322322
323323 def lower_upper (template : Template) -> str :
324324 """ Render static parts lowercased and interpolations uppercased."""
@@ -640,7 +640,7 @@ specifiers like ``:.2f``. The full code is fairly simple:
640640
641641.. code-block :: python
642642
643- from templatelib import Template, Interpolation
643+ from TBD import Template, Interpolation
644644
645645 def convert (value : object , conv : Literal[" a" , " r" , " s" ] | None ) -> object :
646646 if conv == " a" :
@@ -713,7 +713,7 @@ We can implement an improved version of ``StructuredMessage`` using template str
713713.. code-block :: python
714714
715715 import json
716- from templatelib import Interpolation, Template
716+ from TBD import Interpolation, Template
717717 from typing import Mapping
718718
719719 class TemplateMessage :
@@ -770,7 +770,7 @@ and a ``ValuesFormatter`` for JSON output:
770770
771771 import json
772772 from logging import Formatter, LogRecord
773- from templatelib import Interpolation, Template
773+ from TBD import Interpolation, Template
774774 from typing import Any, Mapping
775775
776776
@@ -938,7 +938,7 @@ best practice for many template function implementations:
938938
939939.. code-block :: python
940940
941- from templatelib import Template, Interpolation
941+ from TBD import Template, Interpolation
942942
943943 def process (template : Template) -> Any:
944944 for arg in template.args:
@@ -1314,13 +1314,19 @@ We rejected this in favor of the simpler approach of using plain ``str`` and
13141314allowing combination of ``r `` and ``t `` prefixes.
13151315
13161316
1317- Other Homes for ``Template `` and ``Interpolation ``
1318- --------------------------------------------------
1317+ The Final Home for ``Template `` and ``Interpolation ``
1318+ -----------------------------------------------------
13191319
13201320Previous versions of this PEP proposed placing the ``Template `` and
1321- ``Interpolation `` types in the ``types `` module. Members of the Python core
1322- team internally discussed the various options and ultimately decided to create
1323- a new top-level standard library module, ``templatelib ``.
1321+ ``Interpolation `` types in: ``types ``, ``collections ``, ``collections.abc ``,
1322+ and even in a new top-level module, ``templatelib ``. As of this writing, no core
1323+ team consensus has emerged on the final location for these types. The current
1324+ PEP leaves this open for a final decision.
1325+
1326+ One argument in favor of a new top-level ``templatelib `` module is that it would
1327+ allow for future addition of related methods (like ``convert() `` and ``from_format_string() ``)
1328+ and for potential future template processing code to be added to submodules
1329+ (``templatelib.shell ``, etc.).
13241330
13251331
13261332Enable Full Reconstruction of Original Template Literal
0 commit comments