1111# zkonge <[email protected] >, 20191212# ppcfish <[email protected] >, 20191313# Freesand Leo <[email protected] >, 202014- 1514# jaystone776 <[email protected] >, 20211615#
1716#, fuzzy
@@ -612,43 +611,41 @@ msgid ""
612611"Finally, consider this function definition which has a potential collision "
613612"between the positional argument ``name`` and ``**kwds`` which has ``name`` "
614613"as a key::"
615- msgstr ""
616- "最后,请考虑这个函数定义,它的位置参数 ``name`` 和 ``**kwds`` 之间由于存在关键字名称 ``name`` 而可能产生潜在冲突::"
614+ msgstr "下面的函数定义中,``kwds`` 把 ``name`` 当作键,因此,可能与位置参数 ``name`` 产生潜在冲突:"
617615
618616#: ../../tutorial/controlflow.rst:660
619617msgid ""
620618"There is no possible call that will make it return ``True`` as the keyword "
621619"``'name'`` will always bind to the first parameter. For example::"
622- msgstr "任何调用都不可能让它返回 ``True``,因为关键字 ``'name'`` 将总是绑定到第一个形参。 例如:: "
620+ msgstr "调用该函数不可能返回 ``True``,因为关键字 ``'name'`` 总与第一个形参绑定。例如: "
623621
624622#: ../../tutorial/controlflow.rst:669
625623msgid ""
626624"But using ``/`` (positional only arguments), it is possible since it allows "
627625"``name`` as a positional argument and ``'name'`` as a key in the keyword "
628626"arguments::"
629627msgstr ""
630- "但使用 ``/`` (仅限位置参数) 就可能做到,因为它允许 ``name`` 作为位置参数,也允许 ``'name'`` "
631- "作为关键字参数的关键字名称::"
628+ "加上 ``/`` (仅限位置参数)后,就可以了。此时,函数定义把 ``name`` 当作位置参数,``'name'`` 也可以作为关键字参数的键:"
632629
633630#: ../../tutorial/controlflow.rst:676
634631msgid ""
635632"In other words, the names of positional-only parameters can be used in "
636633"``**kwds`` without ambiguity."
637- msgstr "换句话说,仅限位置形参的名称可以在 ``**kwds`` 中使用而不产生歧义 。"
634+ msgstr "换句话说,仅限位置形参的名称可以在 ``**kwds`` 中使用,而不产生歧义 。"
638635
639636#: ../../tutorial/controlflow.rst:681
640637msgid "Recap"
641- msgstr "概括 "
638+ msgstr "复盘 "
642639
643640#: ../../tutorial/controlflow.rst:683
644641msgid ""
645642"The use case will determine which parameters to use in the function "
646643"definition::"
647- msgstr "用例将确定要在函数定义中使用的参数:: "
644+ msgstr "以下用例决定哪些形参可以用于函数定义: "
648645
649646#: ../../tutorial/controlflow.rst:687
650647msgid "As guidance:"
651- msgstr "作为指导 :"
648+ msgstr "说明 :"
652649
653650#: ../../tutorial/controlflow.rst:689
654651msgid ""
@@ -658,25 +655,24 @@ msgid ""
658655" is called or if you need to take some positional parameters and arbitrary "
659656"keywords."
660657msgstr ""
661- "如果你希望形参名称对用户来说不可用,则使用仅限位置形参。 "
662- "这适用于形参名称没有实际意义,以及当你希望强制规定调用时的参数顺序,或是需要同时收受一些位置形参和任意关键字形参等情况。"
658+ "使用仅限位置形参,可以让用户无法使用形参名。形参名没有实际意义时,强制调用函数的实参顺序时,或同时接收位置形参和任意关键字时,这种方式很有用。"
663659
664660#: ../../tutorial/controlflow.rst:694
665661msgid ""
666662"Use keyword-only when names have meaning and the function definition is more"
667663" understandable by being explicit with names or you want to prevent users "
668664"relying on the position of the argument being passed."
669- msgstr "当形参名称有实际意义,以及显式指定形参名称可使函数定义更易理解,或者当你想要防止用户过于依赖传入参数的位置时,则使用仅限关键字形参 。"
665+ msgstr "当形参名有实际意义,且显式名称可以让函数定义更易理解时,阻止用户依赖传递实参的位置时,才使用关键字 。"
670666
671667#: ../../tutorial/controlflow.rst:697
672668msgid ""
673669"For an API, use positional-only to prevent breaking API changes if the "
674670"parameter's name is modified in the future."
675- msgstr "对于 API 来说,使用仅限位置形参可以防止形参名称在未来被修改时造成破坏性的 API 变动。"
671+ msgstr "对于 API,使用仅限位置形参,可以防止未来修改形参名时造成破坏性的 API 变动。"
676672
677673#: ../../tutorial/controlflow.rst:703
678674msgid "Arbitrary Argument Lists"
679- msgstr "任意的参数列表 "
675+ msgstr "任意实参列表 "
680676
681677#: ../../tutorial/controlflow.rst:708
682678msgid ""
@@ -685,8 +681,8 @@ msgid ""
685681"wrapped up in a tuple (see :ref:`tut-tuples`). Before the variable number "
686682"of arguments, zero or more normal arguments may occur. ::"
687683msgstr ""
688- "最后,最不常用的选项是可以使用任意数量的参数调用函数。这些参数会被包含在一个元组里(参见 :ref:`tut-tuples` "
689- ")。在可变数量的参数之前,可能会出现零个或多个普通参数。:: "
684+ "调用函数时,使用任意数量的实参是最不常用的选项。这些实参包含在一个元组里(详见 :ref:`tut-tuples` "
685+ ")。在可变数量的实参前,可能有零个或多个普通参数: "
690686
691687#: ../../tutorial/controlflow.rst:717
692688msgid ""
0 commit comments