@@ -224,33 +224,33 @@ msgstr "注释的第一行 ``/*[clinic input]`` 是 *起始行* 。"
224224msgid ""
225225"The last line of the initial comment (``[clinic start generated code]*/``) "
226226"is the *end line*."
227- msgstr ""
227+ msgstr "注释(``[clinic start generated code]*/``)的最后一行是 *结束行*。 "
228228
229229#: ../../howto/clinic.rst:133
230230msgid ""
231231"The last line (``/*[clinic end generated code: checksum=...]*/``) is the "
232232"*checksum line*."
233- msgstr ""
233+ msgstr "最后一行(``/*[clinic end generated code: checksum=...]*/``)是 *校验和行* 。 "
234234
235235#: ../../howto/clinic.rst:134
236236msgid "In between the start line and the end line is the *input*."
237- msgstr ""
237+ msgstr "在起始行和结束行之间是 *输入数据*。 "
238238
239239#: ../../howto/clinic.rst:135
240240msgid "In between the end line and the checksum line is the *output*."
241- msgstr ""
241+ msgstr "在结束行和校验和行之间是 *输出数据* 。 "
242242
243243#: ../../howto/clinic.rst:136
244244msgid ""
245245"All the text collectively, from the start line to the checksum line "
246246"inclusively, is the *block*. (A block that hasn't been successfully "
247247"processed by Argument Clinic yet doesn't have output or a checksum line, but"
248248" it's still considered a block.)"
249- msgstr ""
249+ msgstr "从开始行到校验和行的所有文本,都是 *块*。(Argument Clinic 尚未处理成功的块,没有输出或校验和行,但仍视作一个块)。 "
250250
251251#: ../../howto/clinic.rst:143
252252msgid "Converting Your First Function"
253- msgstr ""
253+ msgstr "函数的转换 "
254254
255255#: ../../howto/clinic.rst:145
256256msgid ""
@@ -262,16 +262,19 @@ msgid ""
262262"in the document (like \" return converters\" and \" self converters\" ). But "
263263"we'll keep it simple for this walkthrough so you can learn."
264264msgstr ""
265+ "要想了解 Argument Clinic 是如何工作的,最好的方式就是转换一个函数与之合作。下面介绍需遵循的最基本步骤。请注意,若真的准备在 "
266+ "CPython 中进行检查,则应进行更深入的转换,使用一些本文后续会介绍到的高级概念(比如 “返回转换” 和 "
267+ "“自转换”)。但以下例子将维持简单,以供学习。"
265268
266269#: ../../howto/clinic.rst:154
267270msgid "Let's dive in!"
268- msgstr ""
271+ msgstr "就此开始 "
269272
270273#: ../../howto/clinic.rst:156
271274msgid ""
272275"Make sure you're working with a freshly updated checkout of the CPython "
273276"trunk."
274- msgstr ""
277+ msgstr "请确保 CPython 是最新的已签出版本。 "
275278
276279#: ../../howto/clinic.rst:159
277280msgid ""
@@ -280,12 +283,14 @@ msgid ""
280283"with Argument Clinic yet. For my example I'm using "
281284"``_pickle.Pickler.dump()``."
282285msgstr ""
286+ "找到一个调用 :c:func:`PyArg_ParseTuple` 或 :c:func:`PyArg_ParseTupleAndKeywords` "
287+ ",且未被转换为采用 Argument Clinic 的 Python 内置程序。这里用了 ``_pickle.Pickler.dump()``。"
283288
284289#: ../../howto/clinic.rst:164
285290msgid ""
286291"If the call to the ``PyArg_Parse`` function uses any of the following format"
287292" units:"
288- msgstr ""
293+ msgstr "如果对 ``PyArg_Parse`` 函数的调用采用了以下格式: "
289294
290295#: ../../howto/clinic.rst:176
291296msgid ""
@@ -294,6 +299,8 @@ msgid ""
294299"scenarios. But these are advanced topics—let's do something simpler for "
295300"your first function."
296301msgstr ""
302+ "或者多次调用 :c:func:`PyArg_ParseTuple`,则应再选一个函数。Argument Clinic *确实* 支持上述这些状况。 "
303+ "但这些都是高阶内容——第一次使用就简单一些吧。"
297304
298305#: ../../howto/clinic.rst:181
299306msgid ""
@@ -304,10 +311,13 @@ msgid ""
304311"to Argument Clinic. Argument Clinic doesn't support generic functions or "
305312"polymorphic parameters."
306313msgstr ""
314+ "此外,如果多次调用 :c:func:`PyArg_ParseTuple` 或 :c:func:`PyArg_ParseTupleAndKeywords`"
315+ " 且同一参数需支持不同的类型,或者用到 PyArg_Parse 以外的函数来解析参数,则可能不适合转换为 Argument Clinic。 "
316+ "Argument Clinic 不支持通用函数或多态参数。"
307317
308318#: ../../howto/clinic.rst:188
309319msgid "Add the following boilerplate above the function, creating our block::"
310- msgstr ""
320+ msgstr "在函数上方添加以下模板,创建块: "
311321
312322#: ../../howto/clinic.rst:193
313323msgid ""
@@ -317,6 +327,8 @@ msgid ""
317327" 80 characters. (Argument Clinic will preserve indents inside the "
318328"docstring.)"
319329msgstr ""
330+ "剪下文档字符串并粘贴到 ``[clinic]`` 行之间,去除所有的无用字符,使其成为一个正确引用的 C "
331+ "字符串。最有应该只留下带有左侧缩进的文本,且行宽不大于 80 个字符。(参数 Clinic 将保留文档字符串中的缩进。)"
320332
321333#: ../../howto/clinic.rst:199
322334msgid ""
@@ -325,13 +337,15 @@ msgid ""
325337"``help()`` on your builtin in the future, the first line will be built "
326338"automatically based on the function's signature.)"
327339msgstr ""
340+ "如果文档字符串的第一行看起来像是函数的签名,就把这一行去掉吧。((文档串不再需要用到它——将来对内置函数调用 ``help()`` "
341+ "时,第一行将根据函数的签名自动建立。)"
328342
329343#: ../../howto/clinic.rst:205 ../../howto/clinic.rst:226
330344#: ../../howto/clinic.rst:250 ../../howto/clinic.rst:308
331345#: ../../howto/clinic.rst:348 ../../howto/clinic.rst:375
332346#: ../../howto/clinic.rst:481 ../../howto/clinic.rst:533
333347msgid "Sample::"
334- msgstr ""
348+ msgstr "示例: "
335349
336350#: ../../howto/clinic.rst:211
337351msgid ""
@@ -340,6 +354,8 @@ msgid ""
340354"paragraph consisting of a single 80-column line at the beginning of the "
341355"docstring."
342356msgstr ""
357+ "如果文档字符串中没有“摘要”行,Argument Clinic 会报错。所以应确保带有摘要行。 "
358+ "“摘要”行应为在文档字符串开头的一个段落,由一个80列的单行构成。"
343359
344360#: ../../howto/clinic.rst:216
345361msgid ""
0 commit comments