@@ -33,10 +33,7 @@ To write a t-string, use a ``'t'`` prefix instead of an ``'f'``, like so:
3333
3434 >>> pi = 3.14
3535 >>> t't-strings are new in Python {pi!s}!'
36- Template(
37- strings=('t-strings are new in Python ', '!'),
38- interpolations=(Interpolation(3.14, 'pi', 's', ''),)
39- )
36+ <Template t't-strings are new in Python {pi!s=3.14}!' at 0x...>
4037
4138 Types
4239-----
@@ -118,7 +115,7 @@ Types
118115 >>> cheese = ' Camembert'
119116 >>> template = t' Ah! We do have {cheese} .'
120117 >>> template.interpolations
121- (Interpolation('Camembert', 'cheese', None, '' ),)
118+ (Interpolation('Camembert', 'cheese'),)
122119
123120 The ``interpolations `` tuple may be empty and always contains one fewer
124121 values than the ``strings `` tuple:
@@ -153,7 +150,7 @@ Types
153150 ... ' Ah! We do have ' , Interpolation(cheese, ' cheese' ), ' .'
154151 ... )
155152 >>> list (template)
156- ['Ah! We do have ', Interpolation('Camembert', 'cheese', None, '' ), '.']
153+ ['Ah! We do have ', Interpolation('Camembert', 'cheese'), '.']
157154
158155 If multiple strings are passed consecutively, they will be concatenated
159156 into a single value in the :attr: `~Template.strings ` attribute. For example,
@@ -184,7 +181,7 @@ Types
184181
185182 >>> cheese = ' Camembert'
186183 >>> list (t' Ah! We do have {cheese} .' )
187- ['Ah! We do have ', Interpolation('Camembert', 'cheese', None, '' ), '.']
184+ ['Ah! We do have ', Interpolation('Camembert', 'cheese'), '.']
188185
189186 .. caution ::
190187
@@ -194,8 +191,8 @@ Types
194191 >>> cheese = ' Camembert'
195192 >>> list (t' Ah! {response}{cheese} .' ) # doctest: +NORMALIZE_WHITESPACE
196193 ['Ah! ',
197- Interpolation('We do have ', 'response', None, '' ),
198- Interpolation('Camembert', 'cheese', None, '' ),
194+ Interpolation('We do have ', 'response'),
195+ Interpolation('Camembert', 'cheese'),
199196 '.']
200197
201198 .. describe :: template + other
@@ -206,7 +203,7 @@ Types
206203
207204 >>> cheese = ' Camembert'
208205 >>> list (t' Ah! ' + t' We do have {cheese} .' )
209- ['Ah! We do have ', Interpolation('Camembert', 'cheese', None, '' ), '.']
206+ ['Ah! We do have ', Interpolation('Camembert', 'cheese'), '.']
210207
211208 Concatenating a :class: `!Template ` and a ``str `` is **not ** supported.
212209 This is because it is unclear whether the string should be treated as
@@ -224,7 +221,7 @@ Types
224221 >>> cheese = ' Camembert'
225222 >>> template += Template(Interpolation(cheese, ' cheese' ))
226223 >>> list (template)
227- ['Ah! We do have ', Interpolation('Camembert', 'cheese', None, '' )]
224+ ['Ah! We do have ', Interpolation('Camembert', 'cheese')]
228225
229226
230227.. class :: Interpolation
0 commit comments