Skip to content

Commit 7c11304

Browse files
sync with cpython bb212a1a
1 parent f32592b commit 7c11304

File tree

7 files changed

+2029
-2024
lines changed

7 files changed

+2029
-2024
lines changed

deprecations/index.po

Lines changed: 67 additions & 68 deletions
Large diffs are not rendered by default.

deprecations/pending-removal-in-future.po

Lines changed: 128 additions & 130 deletions
Large diffs are not rendered by default.

library/string.templatelib.po

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.14\n"
99
"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"
1111
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -43,9 +43,9 @@ msgstr "模板字串"
4343
#: ../../library/string.templatelib.rst:24
4444
msgid ""
4545
"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."
4949
msgstr ""
5050

5151
#: ../../library/string.templatelib.rst:30
@@ -81,10 +81,10 @@ msgstr ""
8181

8282
#: ../../library/string.templatelib.rst:49
8383
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``:"
8888
msgstr ""
8989

9090
#: ../../library/string.templatelib.rst:59
@@ -145,12 +145,12 @@ msgstr ""
145145
#: ../../library/string.templatelib.rst:139
146146
msgid ""
147147
"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)``."
150150
msgstr ""
151151

152152
#: ../../library/string.templatelib.rst:144
153-
#: ../../library/string.templatelib.rst:314
153+
#: ../../library/string.templatelib.rst:317
154154
msgid "Methods"
155155
msgstr "方法"
156156

@@ -177,8 +177,8 @@ msgstr ""
177177

178178
#: ../../library/string.templatelib.rst:182
179179
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:"
182182
msgstr ""
183183

184184
#: ../../library/string.templatelib.rst:191
@@ -219,28 +219,32 @@ msgid "The evaluated value of the interpolation."
219219
msgstr ""
220220

221221
#: ../../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."
224229
msgstr ""
225230

226-
#: ../../library/string.templatelib.rst:263
231+
#: ../../library/string.templatelib.rst:268
227232
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."
232236
msgstr ""
233237

234-
#: ../../library/string.templatelib.rst:275
238+
#: ../../library/string.templatelib.rst:278
235239
msgid "The conversion to apply to the value, or ``None``."
236240
msgstr ""
237241

238-
#: ../../library/string.templatelib.rst:277
242+
#: ../../library/string.templatelib.rst:280
239243
msgid ""
240244
"The :attr:`!conversion` is the optional conversion to apply to the value:"
241245
msgstr ""
242246

243-
#: ../../library/string.templatelib.rst:285
247+
#: ../../library/string.templatelib.rst:288
244248
msgid ""
245249
"Unlike f-strings, where conversions are applied automatically, the expected "
246250
"behavior with t-strings is that code that *processes* the :class:`!Template` "
@@ -249,17 +253,17 @@ msgid ""
249253
"conversion semantics."
250254
msgstr ""
251255

252-
#: ../../library/string.templatelib.rst:295
256+
#: ../../library/string.templatelib.rst:298
253257
msgid "The format specification to apply to the value."
254258
msgstr ""
255259

256-
#: ../../library/string.templatelib.rst:297
260+
#: ../../library/string.templatelib.rst:300
257261
msgid ""
258262
"The :attr:`!format_spec` is an optional, arbitrary string used as the format "
259263
"specification to present the value:"
260264
msgstr ""
261265

262-
#: ../../library/string.templatelib.rst:305
266+
#: ../../library/string.templatelib.rst:308
263267
msgid ""
264268
"Unlike f-strings, where format specifications are applied automatically via "
265269
"the :func:`format` protocol, the expected behavior with t-strings is that "
@@ -269,57 +273,61 @@ msgid ""
269273
"not conform to the :func:`format` protocol."
270274
msgstr ""
271275

272-
#: ../../library/string.templatelib.rst:320
276+
#: ../../library/string.templatelib.rst:323
273277
msgid "Create a new :class:`!Interpolation` object from component parts."
274278
msgstr ""
275279

276280
#: ../../library/string.templatelib.rst:0
277281
msgid "Parameters"
278282
msgstr ""
279283

280-
#: ../../library/string.templatelib.rst:322
284+
#: ../../library/string.templatelib.rst:325
281285
msgid "The evaluated, in-scope result of the interpolation."
282286
msgstr ""
283287

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
285293
msgid ""
286294
"The :ref:`conversion <formatstrings>` to be used, one of ``None``, ``'a'``, "
287295
"``'r'``, or ``'s'``."
288296
msgstr ""
289297

290-
#: ../../library/string.templatelib.rst:327
298+
#: ../../library/string.templatelib.rst:330
291299
msgid ""
292300
"An optional, arbitrary string used as the :ref:`format specification "
293301
"<formatspec>` to present the value."
294302
msgstr ""
295303

296-
#: ../../library/string.templatelib.rst:332
304+
#: ../../library/string.templatelib.rst:335
297305
msgid "Helper functions"
298306
msgstr ""
299307

300-
#: ../../library/string.templatelib.rst:336
308+
#: ../../library/string.templatelib.rst:339
301309
msgid ""
302310
"Applies formatted string literal :ref:`conversion <formatstrings-"
303311
"conversion>` semantics to the given object *obj*. This is frequently useful "
304312
"for custom template string processing logic."
305313
msgstr ""
306314

307-
#: ../../library/string.templatelib.rst:340
315+
#: ../../library/string.templatelib.rst:343
308316
msgid "Three conversion flags are currently supported:"
309317
msgstr ""
310318

311-
#: ../../library/string.templatelib.rst:342
319+
#: ../../library/string.templatelib.rst:345
312320
msgid "``'s'`` which calls :func:`str` on the value (like ``!s``),"
313321
msgstr ""
314322

315-
#: ../../library/string.templatelib.rst:343
323+
#: ../../library/string.templatelib.rst:346
316324
msgid "``'r'`` which calls :func:`repr` (like ``!r``), and"
317325
msgstr ""
318326

319-
#: ../../library/string.templatelib.rst:344
327+
#: ../../library/string.templatelib.rst:347
320328
msgid "``'a'`` which calls :func:`ascii` (like ``!a``)."
321329
msgstr ""
322330

323-
#: ../../library/string.templatelib.rst:346
331+
#: ../../library/string.templatelib.rst:349
324332
msgid "If the conversion flag is ``None``, *obj* is returned unchanged."
325333
msgstr ""

0 commit comments

Comments
 (0)