@@ -1733,17 +1733,23 @@ msgid ""
17331733"value), then the generated code will propagate the error. Otherwise it will"
17341734" encode the value you return like normal."
17351735msgstr ""
1736+ "返回值转换器还存在一个复杂的问题:出错信息如何表示?通常函数在执行成功时会返回一个有效(非 ``NULL``)指针,失败则返回 "
1737+ "``NULL``。但如果使用了整数的返回值转换器,所有整数都是有效值。Argument Clinic "
1738+ "怎么检测错误呢?解决方案是:返回值转换器会隐含寻找一个代表错误的特殊值。如果返回该特殊值,且设置了出错标记( ``PyErr_Occurred()`` "
1739+ "返回 True),那么生成的代码会传递该错误。否则,会对返回值进行正常编码。"
17361740
17371741#: ../../howto/clinic.rst:1057
17381742msgid "Currently Argument Clinic supports only a few return converters:"
1739- msgstr ""
1743+ msgstr "目前 Argument Clinic 只支持少数几种返回值转换器。 "
17401744
17411745#: ../../howto/clinic.rst:1072
17421746msgid ""
17431747"None of these take parameters. For the first three, return -1 to indicate "
17441748"error. For ``DecodeFSDefault``, the return type is ``const char *``; return"
17451749" a ``NULL`` pointer to indicate an error."
17461750msgstr ""
1751+ "这些转换器都不需要参数。前3个转换器如果返回 -1 则表示出错。``DecodeFSDefault`` 的返回值类型是 ``const char "
1752+ "*``;若返回 ``NULL`` 指针则表示出错。"
17471753
17481754#: ../../howto/clinic.rst:1076
17491755msgid ""
@@ -1752,53 +1758,57 @@ msgid ""
17521758"the reference count on ``Py_None``. I'm not sure it adds enough clarity to "
17531759"be worth using.)"
17541760msgstr ""
1761+ "(还有一个 ``NoneType`` 转换器是实验性质的,成功时返回 ``Py_None`` ,失败则返回 ``NULL``,且不会增加 "
1762+ "``Py_None`` 的引用计数。此转换器是否值得适用,尚不明确)。"
17551763
17561764#: ../../howto/clinic.rst:1081
17571765msgid ""
17581766"To see all the return converters Argument Clinic supports, along with their "
17591767"parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for "
17601768"the full list."
17611769msgstr ""
1770+ "只要运行 ``Tools/clinic/clinic.py --converters`` ,即可查看 Argument Clinic "
1771+ "支持的所有返回值转换器,包括其参数。"
17621772
17631773#: ../../howto/clinic.rst:1087
17641774msgid "Cloning existing functions"
1765- msgstr ""
1775+ msgstr "复制已有的函数 "
17661776
17671777#: ../../howto/clinic.rst:1089
17681778msgid ""
17691779"If you have a number of functions that look similar, you may be able to use "
17701780"Clinic's \" clone\" feature. When you clone an existing function, you reuse:"
1771- msgstr ""
1781+ msgstr "如果已有一些函数比较相似,或许可以采用 Clinic 的“克隆”功能。 克隆之后能够复用以下内容: "
17721782
17731783#: ../../howto/clinic.rst:1093
17741784msgid "its parameters, including"
1775- msgstr ""
1785+ msgstr "参数,包括: "
17761786
17771787#: ../../howto/clinic.rst:1095
17781788msgid "their names,"
1779- msgstr ""
1789+ msgstr "名称 "
17801790
17811791#: ../../howto/clinic.rst:1097
17821792msgid "their converters, with all parameters,"
1783- msgstr ""
1793+ msgstr "转换器(带有全部参数) "
17841794
17851795#: ../../howto/clinic.rst:1099
17861796msgid "their default values,"
1787- msgstr ""
1797+ msgstr "默认值 "
17881798
17891799#: ../../howto/clinic.rst:1101
17901800msgid "their per-parameter docstrings,"
1791- msgstr ""
1801+ msgstr "参数前的文档字符串 "
17921802
17931803#: ../../howto/clinic.rst:1103
17941804msgid ""
17951805"their *kind* (whether they're positional only, positional or keyword, or "
17961806"keyword only), and"
1797- msgstr ""
1807+ msgstr "*类别* (只认位置、位置或关键字、只认关键字) "
17981808
17991809#: ../../howto/clinic.rst:1106
18001810msgid "its return converter."
1801- msgstr ""
1811+ msgstr "返回值转换器 "
18021812
18031813#: ../../howto/clinic.rst:1108
18041814msgid ""
0 commit comments