Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c37011

Browse files
[po] auto sync
1 parent b1711d7 commit 1c37011

3 files changed

Lines changed: 31 additions & 8 deletions

File tree

library/dataclasses.po

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ msgid ""
262262
"above). If false, or if ``__match_args__`` is already defined in the class,"
263263
" then ``__match_args__`` will not be generated."
264264
msgstr ""
265+
"``match_args``: 如果为真值 (默认值为 ``True``),则将根据传给生成的 :meth:`__init__` 方法的形参列表来创建 "
266+
"``__match_args__`` 元组 (即使没有生成 :meth:`__init__` 也会创建,见上文)。 如果为假值,或者如果 "
267+
"``__match_args__`` 已在类中定义,则将不生成 ``__match_args__``。"
265268

266269
#: ../../library/dataclasses.rst:173
267270
msgid ""
@@ -273,6 +276,10 @@ msgid ""
273276
":term:`parameter` glossary entry for details. Also see the :const:`KW_ONLY`"
274277
" section."
275278
msgstr ""
279+
"``kw_only``: 如果为真值 (默认值为 ``False``),则所有字段都将被标记为仅限关键字。 "
280+
"如果一个字段被标记为仅限关键字,则其唯一的影响是根据仅限关键字的字段生成的 :meth:`__init__` 形参必须使用调用 "
281+
":meth:`__init__` 时传入的关键字来指定。 对于 dataclass 的任何其它方面都没有影响。 请参阅 "
282+
":term:`parameter` 术语表条目了解详情。 另请参阅 :const:`KW_ONLY` 一节。"
276283

277284
#: ../../library/dataclasses.rst:184
278285
msgid ""
@@ -281,6 +288,8 @@ msgid ""
281288
"one. If :attr:`__slots__` is already defined in the class, then "
282289
":exc:`TypeError` is raised."
283290
msgstr ""
291+
"``slots``: 如果为真值 (默认值为 ``False``),则将生成 :attr:`__slots__` 属性并将返回一个新类而非原来的类。 "
292+
"如果 :attr:`__slots__` 已在类中定义,则会引发 :exc:`TypeError`。"
284293

285294
#: ../../library/dataclasses.rst:191
286295
msgid ""
@@ -320,6 +329,9 @@ msgid ""
320329
"This sentinel is used because ``None`` is a valid value for ``default``. No"
321330
" code should directly use the :const:`MISSING` value."
322331
msgstr ""
332+
"如上所示,:const:`MISSING` 是一个监视对象,用于检测是否提供了 ``default`` 和 ``default_factory`` "
333+
"形参。 使用这个监视对象的原因在于 ``None`` 是 ``default`` 的一个有效值。 任何代码都不应直接使用 "
334+
":const:`MISSING` 值。"
323335

324336
#: ../../library/dataclasses.rst:229
325337
msgid "The parameters to :func:`field` are:"
@@ -405,6 +417,7 @@ msgid ""
405417
"``kw_only``: If true, this field will be marked as keyword-only. This is "
406418
"used when the generated :meth:`__init__` method's parameters are computed."
407419
msgstr ""
420+
"``kw_only``: 如果为真值,则此字段将被标记为仅限关键字。 这将在当计算出所生成的 :meth:`__init__` 方法的形参时被使用。"
408421

409422
#: ../../library/dataclasses.rst:278
410423
msgid ""
@@ -451,6 +464,8 @@ msgid ""
451464
" ``metadata``, and ``kw_only`` have the identical meaning and values as they"
452465
" do in the :func:`field` function."
453466
msgstr ""
467+
"``default``, ``default_factory``, ``init``, ``repr``, ``hash``, ``compare``,"
468+
" ``metadata`` 和 ``kw_only`` 具有与 :func:`field` 函数中对应参数相同的含义和值。"
454469

455470
#: ../../library/dataclasses.rst:313
456471
msgid ""

tutorial/controlflow.po

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,15 @@ msgid ""
316316
"(recognized by the \"(...)\" next to them like ``Point`` above) are never "
317317
"assigned to."
318318
msgstr ""
319+
"读取模式的推荐方式是将它们看做是你会在赋值操作左侧放置的内容的扩展形式,以便理解各个变量将会被设置的值。 只有单独的名称 (例如上面的 ``var``)"
320+
" 会被 match 语句所赋值。 带点号的名称 (例如 ``foo.bar``)、属性名称 (例如上面的 ``x=`` 和 ``y=``) 或类名称 "
321+
"(通过其后的 \"(...)\" 来识别,例如上面的 ``Point``) 都绝不会被赋值。"
319322

320323
#: ../../tutorial/controlflow.rst:342
321324
msgid ""
322325
"Patterns can be arbitrarily nested. For example, if we have a short list of"
323326
" points, we could match it like this::"
324-
msgstr ""
327+
msgstr "模式可以任意地嵌套。 例如,如果我们有一个由点组成的短列表,则可以这样匹配它::"
325328

326329
#: ../../tutorial/controlflow.rst:357
327330
msgid ""
@@ -334,14 +337,14 @@ msgstr ""
334337

335338
#: ../../tutorial/controlflow.rst:367
336339
msgid "Several other key features of this statement:"
337-
msgstr ""
340+
msgstr "此语句的一些其他关键特性:"
338341

339342
#: ../../tutorial/controlflow.rst:369
340343
msgid ""
341344
"Like unpacking assignments, tuple and list patterns have exactly the same "
342345
"meaning and actually match arbitrary sequences. An important exception is "
343346
"that they don't match iterators or strings."
344-
msgstr ""
347+
msgstr "类似于解包赋值,元组和列表模式具有完全相同的含义并且实际上能匹配任意序列。 一个重要的例外是它们不能匹配迭代器或字符串。"
345348

346349
#: ../../tutorial/controlflow.rst:373
347350
msgid ""
@@ -350,6 +353,8 @@ msgid ""
350353
"also be ``_``, so ``(x, y, *_)`` matches a sequence of at least two items "
351354
"without binding the remaining items."
352355
msgstr ""
356+
"序列模式支持扩展解包操作: ``[x, y, *rest]`` 和 ``(x, y, *rest)`` 的作用类似于解包赋值。 在 ``*`` "
357+
"之后的名称也可以为 ``_``,因此 ``(x, y, *_)`` 可以匹配包含至少两个条目的序列而不必绑定其余的条目。"
353358

354359
#: ../../tutorial/controlflow.rst:378
355360
msgid ""
@@ -358,6 +363,9 @@ msgid ""
358363
"sequence patterns, extra keys are ignored. An unpacking like ``**rest`` is "
359364
"also supported. (But ``**_`` would be redundant, so it not allowed.)"
360365
msgstr ""
366+
"映射模式: ``{\"bandwidth\": b, \"latency\": l}`` 会从一个字典中捕获 ``\"bandwidth\"`` 和 "
367+
"``\"latency\"`` 的值。 与序列模式不同,额外的键会被忽略。 解包操作例如 ``**rest`` 也受到支持。 (但 ``**_`` "
368+
"是冗余的,因而不被允许。)"
361369

362370
#: ../../tutorial/controlflow.rst:383
363371
msgid "Subpatterns may be captured using the ``as`` keyword::"
@@ -367,25 +375,25 @@ msgstr "子模式可使用 ``as`` 关键字来捕获::"
367375
msgid ""
368376
"will capture the second element of the input as ``p2`` (as long as the input"
369377
" is a sequence of two points)"
370-
msgstr ""
378+
msgstr "将把输入的第二个元素捕获为 ``p2`` (只要输入是包含两个点的序列)"
371379

372380
#: ../../tutorial/controlflow.rst:390
373381
msgid ""
374382
"Most literals are compared by equality, however the singletons ``True``, "
375383
"``False`` and ``None`` are compared by identity."
376-
msgstr ""
384+
msgstr "大多数字面值是按相等性比较的,但是单例对象 ``True``, ``False`` 和 ``None`` 则是按标识号比较的。"
377385

378386
#: ../../tutorial/controlflow.rst:393
379387
msgid ""
380388
"Patterns may use named constants. These must be dotted names to prevent "
381389
"them from being interpreted as capture variable::"
382-
msgstr ""
390+
msgstr "模式可以使用命名常量。 这些命名常量必须为带点号的名称以防止它们被解读为捕获变量::"
383391

384392
#: ../../tutorial/controlflow.rst:410
385393
msgid ""
386394
"For a more detailed explanation and additional examples, you can look into "
387395
":pep:`636` which is written in a tutorial format."
388-
msgstr ""
396+
msgstr "要获取更详细的说明和额外的示例,你可以参阅以教程格式撰写的 :pep:`636`。"
389397

390398
#: ../../tutorial/controlflow.rst:416
391399
msgid "Defining Functions"

whatsnew/3.10.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ msgid ""
702702
" (But ``**_`` would be redundant, so is not allowed.)"
703703
msgstr ""
704704
"映射模式: ``{\"bandwidth\": b, \"latency\": l}`` 会从一个字典中捕获 ``\"bandwidth\"`` 和 "
705-
"``\"latency\"`` 值。 与序列模式不同,额外的键会被忽略。 也支持符 ``**rest``。 (但 ``**_`` "
705+
"``\"latency\"`` 值。 与序列模式不同,额外的键会被忽略。 也支持通配符 ``**rest``。 (但 ``**_`` "
706706
"是冗余的,因而不被允许。)"
707707

708708
#: ../../whatsnew/3.10.rst:659

0 commit comments

Comments
 (0)