7
7
msgstr ""
8
8
"Project-Id-Version : Python 3.14\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
- "POT-Creation-Date : 2025-09-08 15:25+0800 \n "
10
+ "POT-Creation-Date : 2025-10-06 00:15+0000 \n "
11
11
"PO-Revision-Date : YEAR-MO-DA HO:MI+ZONE\n "
12
12
"Last-Translator : FULL NAME <EMAIL@ADDRESS>\n "
13
13
"
Language-Team :
LANGUAGE <[email protected] >\n "
@@ -43,9 +43,9 @@ msgstr "模板字串"
43
43
#: ../../library/string.templatelib.rst:24
44
44
msgid ""
45
45
"Template strings are a mechanism for custom string processing. They have the "
46
- "full flexibility of Python's :ref:`f-strings`, but return "
47
- "a :class: `Template` instance that gives access to the static and "
48
- "interpolated (in curly braces ) parts of a string *before* they are combined."
46
+ "full flexibility of Python's :ref:`f-strings`, but return a :class: "
47
+ "`Template` instance that gives access to the static and interpolated (in "
48
+ "curly brackets ) parts of a string *before* they are combined."
49
49
msgstr ""
50
50
51
51
#: ../../library/string.templatelib.rst:30
@@ -81,10 +81,10 @@ msgstr ""
81
81
82
82
#: ../../library/string.templatelib.rst:49
83
83
msgid ""
84
- "The most common way to create a :class:`!Template` instance is to use "
85
- "the : ref:`template string literal syntax <t-strings>`. This syntax is "
86
- "identical to that of :ref:`f-strings <f-strings>`, except that it uses a "
87
- "``t`` prefix in place of an ``f``:"
84
+ "The most common way to create a :class:`!Template` instance is to use the : "
85
+ "ref:`template string literal syntax <t-strings>`. This syntax is identical "
86
+ "to that of :ref:`f-strings <f-strings>`, except that it uses a ``t`` prefix "
87
+ "in place of an ``f``:"
88
88
msgstr ""
89
89
90
90
#: ../../library/string.templatelib.rst:59
@@ -145,12 +145,12 @@ msgstr ""
145
145
#: ../../library/string.templatelib.rst:139
146
146
msgid ""
147
147
"The ``values`` tuple always has the same length as the ``interpolations`` "
148
- "tuple. It is always equivalent to ``tuple(i.value for i in "
149
- "template. interpolations)``."
148
+ "tuple. It is always equivalent to ``tuple(i.value for i in template. "
149
+ "interpolations)``."
150
150
msgstr ""
151
151
152
152
#: ../../library/string.templatelib.rst:144
153
- #: ../../library/string.templatelib.rst:314
153
+ #: ../../library/string.templatelib.rst:317
154
154
msgid "Methods"
155
155
msgstr "方法"
156
156
@@ -177,8 +177,8 @@ msgstr ""
177
177
178
178
#: ../../library/string.templatelib.rst:182
179
179
msgid ""
180
- "Iterate over the template, yielding each non-empty string "
181
- "and :class: `Interpolation` in the correct order:"
180
+ "Iterate over the template, yielding each non-empty string and :class: "
181
+ "`Interpolation` in the correct order:"
182
182
msgstr ""
183
183
184
184
#: ../../library/string.templatelib.rst:191
@@ -219,28 +219,32 @@ msgid "The evaluated value of the interpolation."
219
219
msgstr ""
220
220
221
221
#: ../../library/string.templatelib.rst:261
222
- #: ../../library/string.templatelib.rst:323
223
- msgid "The text of a valid Python expression, or an empty string."
222
+ msgid ""
223
+ "For interpolations created by t-string literals, :attr:`!expression` is the "
224
+ "expression text found inside the curly brackets (``{`` & ``}``), including "
225
+ "any whitespace, excluding the curly brackets themselves, and ending before "
226
+ "the first ``!``, ``:``, or ``=`` if any is present. For manually created "
227
+ "interpolations, :attr:`!expression` is the arbitrary string provided when "
228
+ "constructing the interpolation instance."
224
229
msgstr ""
225
230
226
- #: ../../library/string.templatelib.rst:263
231
+ #: ../../library/string.templatelib.rst:268
227
232
msgid ""
228
- "The :attr:`.expression` is the original text of the interpolation's Python "
229
- "expression, if the interpolation was created from a t-string literal. "
230
- "Developers creating interpolations manually should either set this to an "
231
- "empty string or choose a suitable valid Python expression."
233
+ "We recommend using valid Python expressions or the empty string for the "
234
+ "``expression`` field of manually created :class:`!Interpolation` instances, "
235
+ "although this is not enforced at runtime."
232
236
msgstr ""
233
237
234
- #: ../../library/string.templatelib.rst:275
238
+ #: ../../library/string.templatelib.rst:278
235
239
msgid "The conversion to apply to the value, or ``None``."
236
240
msgstr ""
237
241
238
- #: ../../library/string.templatelib.rst:277
242
+ #: ../../library/string.templatelib.rst:280
239
243
msgid ""
240
244
"The :attr:`!conversion` is the optional conversion to apply to the value:"
241
245
msgstr ""
242
246
243
- #: ../../library/string.templatelib.rst:285
247
+ #: ../../library/string.templatelib.rst:288
244
248
msgid ""
245
249
"Unlike f-strings, where conversions are applied automatically, the expected "
246
250
"behavior with t-strings is that code that *processes* the :class:`!Template` "
@@ -249,17 +253,17 @@ msgid ""
249
253
"conversion semantics."
250
254
msgstr ""
251
255
252
- #: ../../library/string.templatelib.rst:295
256
+ #: ../../library/string.templatelib.rst:298
253
257
msgid "The format specification to apply to the value."
254
258
msgstr ""
255
259
256
- #: ../../library/string.templatelib.rst:297
260
+ #: ../../library/string.templatelib.rst:300
257
261
msgid ""
258
262
"The :attr:`!format_spec` is an optional, arbitrary string used as the format "
259
263
"specification to present the value:"
260
264
msgstr ""
261
265
262
- #: ../../library/string.templatelib.rst:305
266
+ #: ../../library/string.templatelib.rst:308
263
267
msgid ""
264
268
"Unlike f-strings, where format specifications are applied automatically via "
265
269
"the :func:`format` protocol, the expected behavior with t-strings is that "
@@ -269,57 +273,61 @@ msgid ""
269
273
"not conform to the :func:`format` protocol."
270
274
msgstr ""
271
275
272
- #: ../../library/string.templatelib.rst:320
276
+ #: ../../library/string.templatelib.rst:323
273
277
msgid "Create a new :class:`!Interpolation` object from component parts."
274
278
msgstr ""
275
279
276
280
#: ../../library/string.templatelib.rst:0
277
281
msgid "Parameters"
278
282
msgstr ""
279
283
280
- #: ../../library/string.templatelib.rst:322
284
+ #: ../../library/string.templatelib.rst:325
281
285
msgid "The evaluated, in-scope result of the interpolation."
282
286
msgstr ""
283
287
284
- #: ../../library/string.templatelib.rst:325
288
+ #: ../../library/string.templatelib.rst:326
289
+ msgid "The text of a valid Python expression, or an empty string."
290
+ msgstr ""
291
+
292
+ #: ../../library/string.templatelib.rst:328
285
293
msgid ""
286
294
"The :ref:`conversion <formatstrings>` to be used, one of ``None``, ``'a'``, "
287
295
"``'r'``, or ``'s'``."
288
296
msgstr ""
289
297
290
- #: ../../library/string.templatelib.rst:327
298
+ #: ../../library/string.templatelib.rst:330
291
299
msgid ""
292
300
"An optional, arbitrary string used as the :ref:`format specification "
293
301
"<formatspec>` to present the value."
294
302
msgstr ""
295
303
296
- #: ../../library/string.templatelib.rst:332
304
+ #: ../../library/string.templatelib.rst:335
297
305
msgid "Helper functions"
298
306
msgstr ""
299
307
300
- #: ../../library/string.templatelib.rst:336
308
+ #: ../../library/string.templatelib.rst:339
301
309
msgid ""
302
310
"Applies formatted string literal :ref:`conversion <formatstrings-"
303
311
"conversion>` semantics to the given object *obj*. This is frequently useful "
304
312
"for custom template string processing logic."
305
313
msgstr ""
306
314
307
- #: ../../library/string.templatelib.rst:340
315
+ #: ../../library/string.templatelib.rst:343
308
316
msgid "Three conversion flags are currently supported:"
309
317
msgstr ""
310
318
311
- #: ../../library/string.templatelib.rst:342
319
+ #: ../../library/string.templatelib.rst:345
312
320
msgid "``'s'`` which calls :func:`str` on the value (like ``!s``),"
313
321
msgstr ""
314
322
315
- #: ../../library/string.templatelib.rst:343
323
+ #: ../../library/string.templatelib.rst:346
316
324
msgid "``'r'`` which calls :func:`repr` (like ``!r``), and"
317
325
msgstr ""
318
326
319
- #: ../../library/string.templatelib.rst:344
327
+ #: ../../library/string.templatelib.rst:347
320
328
msgid "``'a'`` which calls :func:`ascii` (like ``!a``)."
321
329
msgstr ""
322
330
323
- #: ../../library/string.templatelib.rst:346
331
+ #: ../../library/string.templatelib.rst:349
324
332
msgid "If the conversion flag is ``None``, *obj* is returned unchanged."
325
333
msgstr ""
0 commit comments