1111# df2dc1c92e792f7ae8417c51df43db8f_594d92a <0f49be28017426edb1db1a2ab6e67088_717605>, 2021
1212# ppcfish <[email protected] >, 20211313# Dai Xu <[email protected] >, 202214+ # Freesand Leo <[email protected] >, 20221415#
1516#, fuzzy
1617msgid ""
@@ -19,7 +20,7 @@ msgstr ""
1920"Report-Msgid-Bugs-To : \n "
2021"POT-Creation-Date : 2021-06-29 12:56+0000\n "
2122"PO-Revision-Date : 2021-06-28 00:52+0000\n "
22- "Last-Translator : Dai Xu <daixu61@hotmail .com>, 2022\n "
23+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2022\n "
2324"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2425"MIME-Version : 1.0\n "
2526"Content-Type : text/plain; charset=UTF-8\n "
@@ -417,18 +418,19 @@ msgstr "这些参数行的常规形式如下:"
417418
418419#: ../../howto/clinic.rst:276
419420msgid "If the parameter has a default value, add that after the converter:"
420- msgstr "如果参数带有默认值 ,请加在转换器之后:"
421+ msgstr "如果参数带有缺省值 ,请加在转换器之后:"
421422
422423#: ../../howto/clinic.rst:283
423424msgid ""
424425"Argument Clinic's support for \" default values\" is quite sophisticated; "
425426"please see :ref:`the section below on default values <default_values>` for "
426427"more information."
427428msgstr ""
429+ "Argument Clinic 对 “缺省值” 的支持方式相当复杂;更多信息请参见 :ref:`关于缺省值的部分 <default_values>` 。"
428430
429431#: ../../howto/clinic.rst:287
430432msgid "Add a blank line below the parameters."
431- msgstr ""
433+ msgstr "在参数行下面添加一个空行。 "
432434
433435#: ../../howto/clinic.rst:289
434436msgid ""
@@ -438,6 +440,8 @@ msgid ""
438440"convenience syntax intended to make porting old code into Argument Clinic "
439441"easier."
440442msgstr ""
443+ " “转换器”是什么?它既确定了 C 语言要采用的变量类型,又确定了运行时将 Python 值转换成 C "
444+ "语言值的方法。现在需用到的是所谓“传统转换器”——快捷语法,旨在让旧代码更容易移植到 Argument Clinic。"
441445
442446#: ../../howto/clinic.rst:296
443447msgid ""
@@ -448,57 +452,63 @@ msgid ""
448452"parsing function what the type of the variable is and how to convert it. "
449453"For more on format units please see :ref:`arg-parsing`.)"
450454msgstr ""
455+ "每个参数都要从``PyArg_Parse()`` 格式参数中复制其 “格式单元”,并以带引号字符串的形式指定其转换器。(“格式单元”是 "
456+ "``format`` 参数的1-3个字符的正式名称,用于让参数解析函数知晓该变量的类型及转换方法。关于格式单位的更多信息,请参阅 :ref:`arg-"
457+ "parsing` )。"
451458
452459#: ../../howto/clinic.rst:305
453460msgid ""
454461"For multicharacter format units like ``z#``, use the entire two-or-three "
455462"character string."
456- msgstr ""
463+ msgstr "对于像 ``z#`` 这样的多字符格式单元,要使用2-3个字符组成的整个字符串。 "
457464
458465#: ../../howto/clinic.rst:323
459466msgid ""
460467"If your function has ``|`` in the format string, meaning some parameters "
461468"have default values, you can ignore it. Argument Clinic infers which "
462469"parameters are optional based on whether or not they have default values."
463470msgstr ""
471+ "如果函数的格式字符串包含 ``|``,意味着有些参数带有缺省值,这可以忽略。Argument Clinic 根据参数是否有缺省值来推断哪些参数是可选的。"
464472
465473#: ../../howto/clinic.rst:328
466474msgid ""
467475"If your function has ``$`` in the format string, meaning it takes keyword-"
468476"only arguments, specify ``*`` on a line by itself before the first keyword-"
469477"only argument, indented the same as the parameter lines."
470- msgstr ""
478+ msgstr "如果函数的格式字符串中包含 $,意味着只接受关键字参数,请在第一个关键字参数之前单独给出一行 ``*``,缩进与参数行对齐。 "
471479
472480#: ../../howto/clinic.rst:333
473481msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)"
474- msgstr ""
482+ msgstr "(``_pickle.Pickler.dump`` 两种格式字符串都没有,所以这里的示例不用改动。) "
475483
476484#: ../../howto/clinic.rst:336
477485msgid ""
478486"If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to "
479487":c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are "
480488"positional-only."
481489msgstr ""
490+ "如果 C 函数调用的是 :c:func:`PyArg_ParseTuple` (而不是 "
491+ ":c:func:`PyArg_ParseTupleAndKeywords`),那么其所有参数均是仅限位置参数。"
482492
483493#: ../../howto/clinic.rst:340
484494msgid ""
485495"To mark all parameters as positional-only in Argument Clinic, add a ``/`` on"
486496" a line by itself after the last parameter, indented the same as the "
487497"parameter lines."
488- msgstr ""
498+ msgstr "若要在 Argument Clinic 中把所有参数都标记为只认位置,请在最后一个参数后面一行加入一个 ``/``,缩进程度与参数行对齐。 "
489499
490500#: ../../howto/clinic.rst:344
491501msgid ""
492502"Currently this is all-or-nothing; either all parameters are positional-only,"
493503" or none of them are. (In the future Argument Clinic may relax this "
494504"restriction.)"
495- msgstr ""
505+ msgstr "目前这个标记是全体生效;要么所有参数都是只认位置,要么都不是。(以后 Argument Clinic 可能会放宽这一限制。) "
496506
497507#: ../../howto/clinic.rst:364
498508msgid ""
499509"It's helpful to write a per-parameter docstring for each parameter. But per-"
500510"parameter docstrings are optional; you can skip this step if you prefer."
501- msgstr ""
511+ msgstr "为每个参数都编写一个文档字符串,这很有意义。但这是可选项;可以跳过这一步。 "
502512
503513#: ../../howto/clinic.rst:368
504514msgid ""
@@ -509,33 +519,39 @@ msgid ""
509519"this amount. You can write as much text as you like, across multiple lines "
510520"if you wish."
511521msgstr ""
522+ "下面介绍如何添加逐参数的文档字符串。逐参数文档字符串的第一行必须比参数定义多缩进一层。第一行的左边距即确定了所有逐参数文档字符串的左边距;所有文档字符串文本都要同等缩进。文本可以用多行编写。"
512523
513524#: ../../howto/clinic.rst:392
514525msgid ""
515526"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With "
516527"luck everything worked---your block now has output, and a ``.c.h`` file has "
517528"been generated! Reopen the file in your text editor to see::"
518529msgstr ""
530+ "保存并关闭该文件,然后运行 ``Tools/clinic/clinic.py`` 。 运气好的话就万事大吉——程序块现在有了输出信息,并且生成了一个 "
531+ "``.c.h`` 文件!在文本编辑器中重新打开该文件,可以看到:"
519532
520533#: ../../howto/clinic.rst:411
521534msgid ""
522535"Obviously, if Argument Clinic didn't produce any output, it's because it "
523536"found an error in your input. Keep fixing your errors and retrying until "
524537"Argument Clinic processes your file without complaint."
525538msgstr ""
539+ "显然,如果 Argument Clinic 未产生任何输出,那是因为在输入信息中发现了错误。继续修正错误并重试,直至 Argument Clinic "
540+ "正确地处理好文件。"
526541
527542#: ../../howto/clinic.rst:415
528543msgid ""
529544"For readability, most of the glue code has been generated to a ``.c.h`` "
530545"file. You'll need to include that in your original ``.c`` file, typically "
531546"right after the clinic module block::"
532547msgstr ""
548+ "为了便于阅读,大部分“胶水”代码已写入 ``.c.h`` 文件中。需在原 ``.c`` 文件中包含这个文件,通常是在 clinic 模块之后:"
533549
534550#: ../../howto/clinic.rst:421
535551msgid ""
536552"Double-check that the argument-parsing code Argument Clinic generated looks "
537553"basically the same as the existing code."
538- msgstr ""
554+ msgstr "请仔细检查 Argument Clinic 生成的参数解析代码,是否与原有代码基本相同。 "
539555
540556#: ../../howto/clinic.rst:424
541557msgid ""
@@ -544,13 +560,18 @@ msgid ""
544560":c:func:`PyArg_ParseTupleAndKeywords`; ensure that the code generated by "
545561"Argument Clinic calls the *exact* same function."
546562msgstr ""
563+ "首先,确保两种代码使用相同的参数解析函数。原有代码必须调用 :c:func:`PyArg_ParseTuple` 或 "
564+ ":c:func:`PyArg_ParseTupleAndKeywords` ;确保 Argument Clinic 生成的代码调用 *完全* "
565+ "相同的函数。"
547566
548567#: ../../howto/clinic.rst:430
549568msgid ""
550569"Second, the format string passed in to :c:func:`PyArg_ParseTuple` or "
551570":c:func:`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the "
552571"hand-written one in the existing function, up to the colon or semi-colon."
553572msgstr ""
573+ "其次,传给 :c:func:`PyArg_ParseTuple` 或 :c:func:`PyArg_ParseTupleAndKeywords` "
574+ "的格式字符串应该 *完全* 与原有函数中的相同,直到冒号或分号为止。"
554575
555576#: ../../howto/clinic.rst:435
556577msgid ""
0 commit comments