1414# Dai Xu <[email protected] >, 20231515# cissoid <[email protected] >, 20231616# Freesand Leo <[email protected] >, 202317- # 乐成 王, 2023
1817# LeeWendao <[email protected] >, 202318+ # 乐成 王, 2023
1919#
2020#, fuzzy
2121msgid ""
@@ -24,7 +24,7 @@ msgstr ""
2424"Report-Msgid-Bugs-To : \n "
2525"POT-Creation-Date : 2023-08-11 14:13+0000\n "
2626"PO-Revision-Date : 2021-06-28 01:50+0000\n "
27- "
Last-Translator :
LeeWendao <[email protected] > , 2023\n"
27+ "Last-Translator : 乐成 王 , 2023\n "
2828"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2929"MIME-Version : 1.0\n "
3030"Content-Type : text/plain; charset=UTF-8\n "
@@ -303,15 +303,15 @@ msgid ""
303303" which makes it conceptually similar to the unpacking assignment ``(x, y) = "
304304"point``."
305305msgstr ""
306- "请仔细学习此代码!第一个模式有两个字面值,可视为前述字面值模式的扩展。但接下来的两个模式结合了一个字面值和一个变量,而变量 *绑定* "
307- "了来自主语(``point``)的一个值。第四个模式捕获了两个值,使它在概念上与解包赋值 ``(x, y) = point`` 类似。"
306+ "请仔细学习此代码!第一个模式有两个字面值,可视为前述字面值模式的扩展。接下来的两个模式结合了一个字面值和一个变量,变量 *绑定* "
307+ "了来自主语(``point``)的一个值。第四个模式捕获了两个值,使其在概念上与解包赋值 ``(x, y) = point`` 类似。"
308308
309309#: ../../tutorial/controlflow.rst:312
310310msgid ""
311311"If you are using classes to structure your data you can use the class name "
312312"followed by an argument list resembling a constructor, but with the ability "
313313"to capture attributes into variables::"
314- msgstr "如果用类组织数据,可以用类名后接一个和构造器一致的参数列表,不过,它有把属性捕获到变量里的能力 :"
314+ msgstr "如果用类组织数据,可以用“类名后接一个参数列表”这种很像构造器的形式,把属性捕获到变量里 :"
315315
316316#: ../../tutorial/controlflow.rst:334
317317msgid ""
@@ -322,9 +322,9 @@ msgid ""
322322" \" y\" ), the following patterns are all equivalent (and all bind the ``y`` "
323323"attribute to the ``var`` variable)::"
324324msgstr ""
325- "可在 dataclass 等支持属性排序的内置类中使用位置参数。还可在类中设置 ``__match_args__`` "
326- "特殊属性为模式的属性定义指定位置 。如果它被设为 (\" x\" , \" y\" ),则以下模式均为等价的,并且都把 ``y`` 属性绑定到 ``var`` "
327- "变量 :"
325+ "一些内置类(如 dataclass)为属性提供了顺序,此时可以使用位置参数。自定义类可通过在类中设置 ``__match_args__`` "
326+ "特殊属性为属性指定其在模式中对应的位置 。如果它被设为 (\" x\" , \" y\" ),则以下模式相互等价(且都把属性 ``y`` 绑定到变量 "
327+ "``var``) :"
328328
329329#: ../../tutorial/controlflow.rst:345
330330msgid ""
@@ -336,25 +336,26 @@ msgid ""
336336"(recognized by the \" (...)\" next to them like ``Point`` above) are never "
337337"assigned to."
338338msgstr ""
339- "读取模式的推荐方式是将它们看做是你会在赋值操作左侧放置的内容的扩展形式,以便理解各个变量将会被设置的值。 只有单独的名称(例如上面的 "
340- "``var``)会被 match 语句所赋值。 带点号的名称 (例如 ``foo.bar``)、属性名称(例如上面的 ``x=`` 和 "
341- "``y=``)或类名称(通过其后的 \" (...) \" 来识别,例如上面的 ``Point``)都绝不会被赋值 。"
339+ "建议这样来阅读一个模式——视其为赋值语句等号左边的一种形式,来理解各个变量将被设为何值。只有独立名称(如上面的 ``var``)会被 match "
340+ "语句赋值,而带点号的名称(如 ``foo.bar``)、属性名(如上面的 ``x=`` 和 ``y=``)以及类名(是通过其后的 \" (...) \" "
341+ "来识别的,如上面的 ``Point``)都不会被赋值 。"
342342
343343#: ../../tutorial/controlflow.rst:352
344344msgid ""
345345"Patterns can be arbitrarily nested. For example, if we have a short list of"
346346" Points, with ``__match_args__`` added, we could match it like this::"
347347msgstr ""
348- "模式可以被任意地嵌套。 举例来说,如果我一个由 Point 组成的列表,当添加了 ``__match_args__`` 时,我们可以这样来匹配它::"
348+ "模式可以任意嵌套。举例来说,如果我们有一个由 Point 组成的列表,且 Point 添加了 ``__match_args__`` "
349+ "时,我们可以这样来匹配它:"
349350
350351#: ../../tutorial/controlflow.rst:373
351352msgid ""
352353"We can add an ``if`` clause to a pattern, known as a \" guard\" . If the "
353354"guard is false, ``match`` goes on to try the next case block. Note that "
354355"value capture happens before the guard is evaluated::"
355356msgstr ""
356- "为模式添加成为守护项的 ``if`` 子句。如果守护项的值为假,则 ``match`` 继续匹配下一个 case "
357- "语句块。注意,值的捕获发生在守护项被求值之前 :"
357+ "我们可以为模式添加 ``if`` 作为守卫子句。如果守卫子句的值为假,那么 ``match`` 会继续尝试匹配下一个 case "
358+ "块。注意是先将值捕获,再对守卫子句求值 :"
358359
359360#: ../../tutorial/controlflow.rst:383
360361msgid "Several other key features of this statement:"
0 commit comments