@@ -316,12 +316,15 @@ msgid ""
316316"(recognized by the \" (...)\" next to them like ``Point`` above) are never "
317317"assigned to."
318318msgstr ""
319+ "读取模式的推荐方式是将它们看做是你会在赋值操作左侧放置的内容的扩展形式,以便理解各个变量将会被设置的值。 只有单独的名称 (例如上面的 ``var``)"
320+ " 会被 match 语句所赋值。 带点号的名称 (例如 ``foo.bar``)、属性名称 (例如上面的 ``x=`` 和 ``y=``) 或类名称 "
321+ "(通过其后的 \" (...)\" 来识别,例如上面的 ``Point``) 都绝不会被赋值。"
319322
320323#: ../../tutorial/controlflow.rst:342
321324msgid ""
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
327330msgid ""
@@ -334,14 +337,14 @@ msgstr ""
334337
335338#: ../../tutorial/controlflow.rst:367
336339msgid "Several other key features of this statement:"
337- msgstr ""
340+ msgstr "此语句的一些其他关键特性: "
338341
339342#: ../../tutorial/controlflow.rst:369
340343msgid ""
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
347350msgid ""
@@ -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."
352355msgstr ""
356+ "序列模式支持扩展解包操作: ``[x, y, *rest]`` 和 ``(x, y, *rest)`` 的作用类似于解包赋值。 在 ``*`` "
357+ "之后的名称也可以为 ``_``,因此 ``(x, y, *_)`` 可以匹配包含至少两个条目的序列而不必绑定其余的条目。"
353358
354359#: ../../tutorial/controlflow.rst:378
355360msgid ""
@@ -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.)"
360365msgstr ""
366+ "映射模式: ``{\" bandwidth\" : b, \" latency\" : l}`` 会从一个字典中捕获 ``\" bandwidth\" `` 和 "
367+ "``\" latency\" `` 的值。 与序列模式不同,额外的键会被忽略。 解包操作例如 ``**rest`` 也受到支持。 (但 ``**_`` "
368+ "是冗余的,因而不被允许。)"
361369
362370#: ../../tutorial/controlflow.rst:383
363371msgid "Subpatterns may be captured using the ``as`` keyword::"
@@ -367,25 +375,25 @@ msgstr "子模式可使用 ``as`` 关键字来捕获::"
367375msgid ""
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
373381msgid ""
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
379387msgid ""
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
385393msgid ""
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
391399msgid "Defining Functions"
0 commit comments