@@ -624,25 +624,28 @@ msgid ""
624624"between the positional argument ``name`` and ``**kwds`` which has ``name`` "
625625"as a key::"
626626msgstr ""
627+ "最后,请考虑这个函数定义,它的位置参数 ``name`` 和 ``**kwds`` 之间由于存在关键字名称 ``name`` 而可能产生潜在冲突::"
627628
628629#: ../../tutorial/controlflow.rst:661
629630msgid ""
630631"There is no possible call that will make it return ``True`` as the keyword "
631632"``'name'`` will always to bind to the first parameter. For example::"
632- msgstr ""
633+ msgstr "任何调用都不可能让它返回 ``True``,因为关键字 ``'name'`` 将总是绑定到第一个形参。 例如:: "
633634
634635#: ../../tutorial/controlflow.rst:670
635636msgid ""
636637"But using ``/`` (positional only arguments), it is possible since it allows "
637638"``name`` as a positional argument and ``'name'`` as a key in the keyword "
638639"arguments::"
639640msgstr ""
641+ "但使用 ``/`` (仅限位置参数) 就可能做到,因为它允许 ``name`` 作为位置参数,也允许 ``'name'`` "
642+ "作为关键字参数的关键字名称::"
640643
641644#: ../../tutorial/controlflow.rst:677
642645msgid ""
643646"In other words, the names of positional-only parameters can be used in "
644647"``**kwds`` without ambiguity."
645- msgstr ""
648+ msgstr "换句话说,仅限位置形参的名称可以在 ``**kwds`` 中使用而不产生歧义。 "
646649
647650#: ../../tutorial/controlflow.rst:682
648651msgid "Recap"
@@ -666,19 +669,21 @@ msgid ""
666669" is called or if you need to take some positional parameters and arbitrary "
667670"keywords."
668671msgstr ""
672+ "如果你希望形参名称对用户来说不可用,则使用仅限位置形参。 "
673+ "这适用于形参名称没有实际意义,以及当你希望强制规定调用时的参数顺序,或是需要同时收受一些位置形参和任意关键字形参等情况。"
669674
670675#: ../../tutorial/controlflow.rst:695
671676msgid ""
672677"Use keyword-only when names have meaning and the function definition is more"
673678" understandable by being explicit with names or you want to prevent users "
674679"relying on the position of the argument being passed."
675- msgstr ""
680+ msgstr "当形参名称有实际意义,以及显式指定形参名称可使函数定义更易理解,或者当你想要防止用户过于依赖传入参数的位置时,则使用仅限关键字形参。 "
676681
677682#: ../../tutorial/controlflow.rst:698
678683msgid ""
679684"For an API, use positional-only to prevent breaking API changes if the "
680685"parameter's name is modified in the future."
681- msgstr ""
686+ msgstr "对于 API 来说,使用仅限位置形参可以防止形参名称在未来被修改时造成破坏性的 API 变动。 "
682687
683688#: ../../tutorial/controlflow.rst:704
684689msgid "Arbitrary Argument Lists"
0 commit comments