66# Translators:
77# Shengjing Zhu <[email protected] >, 201888# telnetning <[email protected] >, 20189- # Freesand Leo <[email protected] >, 2018109# df2dc1c92e792f7ae8417c51df43db8f_594d92a <0f49be28017426edb1db1a2ab6e67088_717605>, 2018
1110# Alpha Du <[email protected] >, 20191211# ppcfish <[email protected] >, 20191312# Dai Xu <[email protected] >, 202213+ # Freesand Leo <[email protected] >, 20221414#
1515#, fuzzy
1616msgid ""
@@ -19,7 +19,7 @@ msgstr ""
1919"Report-Msgid-Bugs-To : \n "
2020"POT-Creation-Date : 2021-01-01 05:02+0000\n "
2121"PO-Revision-Date : 2017-02-16 17:44+0000\n "
22- "Last-Translator : Dai Xu <daixu61@hotmail .com>, 2022\n "
22+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2022\n "
2323"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2424"MIME-Version : 1.0\n "
2525"Content-Type : text/plain; charset=UTF-8\n "
@@ -451,57 +451,63 @@ msgid ""
451451"parsing function what the type of the variable is and how to convert it. "
452452"For more on format units please see :ref:`arg-parsing`.)"
453453msgstr ""
454+ "每个参数都要从``PyArg_Parse()`` 格式参数中复制其 “格式单元”,并以带引号字符串的形式指定其转换器。(“格式单元”是 "
455+ "``format`` 参数的1-3个字符的正式名称,用于让参数解析函数知晓该变量的类型及转换方法。关于格式单位的更多信息,请参阅 :ref:`arg-"
456+ "parsing` )。"
454457
455458#: ../../howto/clinic.rst:305
456459msgid ""
457460"For multicharacter format units like ``z#``, use the entire two-or-three "
458461"character string."
459- msgstr ""
462+ msgstr "对于像 ``z#`` 这样的多字符格式单元,要使用2-3个字符组成的整个字符串。 "
460463
461464#: ../../howto/clinic.rst:323
462465msgid ""
463466"If your function has ``|`` in the format string, meaning some parameters "
464467"have default values, you can ignore it. Argument Clinic infers which "
465468"parameters are optional based on whether or not they have default values."
466469msgstr ""
470+ "如果函数的格式字符串包含 ``|``,意味着有些参数带有缺省值,这可以忽略。Argument Clinic 根据参数是否有缺省值来推断哪些参数是可选的。"
467471
468472#: ../../howto/clinic.rst:328
469473msgid ""
470474"If your function has ``$`` in the format string, meaning it takes keyword-"
471475"only arguments, specify ``*`` on a line by itself before the first keyword-"
472476"only argument, indented the same as the parameter lines."
473- msgstr ""
477+ msgstr "如果函数的格式字符串中包含 $,意味着只接受关键字参数,请在第一个关键字参数之前单独给出一行 ``*``,缩进与参数行对齐。 "
474478
475479#: ../../howto/clinic.rst:333
476480msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)"
477- msgstr ""
481+ msgstr "(``_pickle.Pickler.dump`` 两种格式字符串都没有,所以这里的示例不用改动。) "
478482
479483#: ../../howto/clinic.rst:336
480484msgid ""
481485"If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to "
482486":c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are "
483487"positional-only."
484488msgstr ""
489+ "如果 C 函数调用的是 :c:func:`PyArg_ParseTuple` (而不是 "
490+ ":c:func:`PyArg_ParseTupleAndKeywords`),那么其所有参数均是仅限位置参数。"
485491
486492#: ../../howto/clinic.rst:340
487493msgid ""
488494"To mark all parameters as positional-only in Argument Clinic, add a ``/`` on"
489495" a line by itself after the last parameter, indented the same as the "
490496"parameter lines."
491- msgstr ""
497+ msgstr "若要在 Argument Clinic 中把所有参数都标记为只认位置,请在最后一个参数后面一行加入一个 ``/``,缩进程度与参数行对齐。 "
492498
493499#: ../../howto/clinic.rst:344
494500msgid ""
495501"Currently this is all-or-nothing; either all parameters are positional-only,"
496502" or none of them are. (In the future Argument Clinic may relax this "
497503"restriction.)"
498- msgstr ""
504+ msgstr "目前这个标记是全体生效;要么所有参数都是只认位置,要么都不是。(以后 Argument Clinic 可能会放宽这一限制。) "
499505
500506#: ../../howto/clinic.rst:364
501507msgid ""
502508"It's helpful to write a per-parameter docstring for each parameter. But per-"
503509"parameter docstrings are optional; you can skip this step if you prefer."
504- msgstr ""
510+ msgstr "为每个参数都编写一个文档字符串,这很有意义。但这是可选项;可以跳过这一步。 "
505511
506512#: ../../howto/clinic.rst:368
507513msgid ""
@@ -512,33 +518,39 @@ msgid ""
512518"this amount. You can write as much text as you like, across multiple lines "
513519"if you wish."
514520msgstr ""
521+ "下面介绍如何添加逐参数的文档字符串。逐参数文档字符串的第一行必须比参数定义多缩进一层。第一行的左边距即确定了所有逐参数文档字符串的左边距;所有文档字符串文本都要同等缩进。文本可以用多行编写。"
515522
516523#: ../../howto/clinic.rst:392
517524msgid ""
518525"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With "
519526"luck everything worked---your block now has output, and a ``.c.h`` file has "
520527"been generated! Reopen the file in your text editor to see::"
521528msgstr ""
529+ "保存并关闭该文件,然后运行 ``Tools/clinic/clinic.py`` 。 运气好的话就万事大吉——程序块现在有了输出信息,并且生成了一个 "
530+ "``.c.h`` 文件!在文本编辑器中重新打开该文件,可以看到:"
522531
523532#: ../../howto/clinic.rst:411
524533msgid ""
525534"Obviously, if Argument Clinic didn't produce any output, it's because it "
526535"found an error in your input. Keep fixing your errors and retrying until "
527536"Argument Clinic processes your file without complaint."
528537msgstr ""
538+ "显然,如果 Argument Clinic 未产生任何输出,那是因为在输入信息中发现了错误。继续修正错误并重试,直至 Argument Clinic "
539+ "正确地处理好文件。"
529540
530541#: ../../howto/clinic.rst:415
531542msgid ""
532543"For readability, most of the glue code has been generated to a ``.c.h`` "
533544"file. You'll need to include that in your original ``.c`` file, typically "
534545"right after the clinic module block::"
535546msgstr ""
547+ "为了便于阅读,大部分“胶水”代码已写入 ``.c.h`` 文件中。需在原 ``.c`` 文件中包含这个文件,通常是在 clinic 模块之后:"
536548
537549#: ../../howto/clinic.rst:421
538550msgid ""
539551"Double-check that the argument-parsing code Argument Clinic generated looks "
540552"basically the same as the existing code."
541- msgstr ""
553+ msgstr "请仔细检查 Argument Clinic 生成的参数解析代码,是否与现有代码基本相同。 "
542554
543555#: ../../howto/clinic.rst:424
544556msgid ""
@@ -547,13 +559,18 @@ msgid ""
547559":c:func:`PyArg_ParseTupleAndKeywords`; ensure that the code generated by "
548560"Argument Clinic calls the *exact* same function."
549561msgstr ""
562+ "首先,确保两种代码使用相同的参数解析函数。已有代码必须调用 :c:func:`PyArg_ParseTuple` 或 "
563+ ":c:func:`PyArg_ParseTupleAndKeywords` ;确保 Argument Clinic 生成的代码调用 *完全* "
564+ "相同的函数。"
550565
551566#: ../../howto/clinic.rst:430
552567msgid ""
553568"Second, the format string passed in to :c:func:`PyArg_ParseTuple` or "
554569":c:func:`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the "
555570"hand-written one in the existing function, up to the colon or semi-colon."
556571msgstr ""
572+ "其次,传给 :c:func:`PyArg_ParseTuple` 或 :c:func:`PyArg_ParseTupleAndKeywords` "
573+ "的格式字符串应该 *完全* 与原有函数中的相同,直到冒号或分号为止。"
557574
558575#: ../../howto/clinic.rst:435
559576msgid ""
0 commit comments