@@ -64,10 +64,13 @@ msgid ""
6464"Argument Clinic that ships with the next version of CPython *could* be "
6565"totally incompatible and break all your code."
6666msgstr ""
67+ "目前 Argument Clinic 视作仅供 CPython 内部使用。不支持在 CPython "
68+ "之外的文件中使用,也不保证未来版本会向下兼容。换句话说:如果维护的是 CPython 的外部 C 语言扩展,欢迎在自己的代码中试用 Argument "
69+ "Clinic。但 Argument Clinic 与新版 CPython 中的版本 *可能* 完全不兼容,且会打乱全部代码。"
6770
6871#: ../../howto/clinic.rst:29
6972msgid "The Goals Of Argument Clinic"
70- msgstr ""
73+ msgstr "Argument Clinic 的设计目标 "
7174
7275#: ../../howto/clinic.rst:31
7376msgid ""
@@ -79,6 +82,10 @@ msgid ""
7982"gets called at the bottom, with ``PyObject *args`` (and maybe ``PyObject "
8083"*kwargs``) magically converted into the C variables and types you need."
8184msgstr ""
85+ "Argument Clinic 的主要目标,是接管 CPython 中的所有参数解析代码。这意味着,如果要把某个函数转换为配合 Argument "
86+ "Clinic一起工作,则该函数不应再作任何参数解析工作——Argument Clinic 生成的代码应该是个“黑盒”,CPython "
87+ "会在顶部发起调用,底部则调用自己的代码, ``PyObject *args`` (也许还有 ``PyObject *kwargs`` "
88+ ")会神奇地转换成所需的 C 变量和类型。"
8289
8390#: ../../howto/clinic.rst:41
8491msgid ""
@@ -87,6 +94,8 @@ msgid ""
8794"chore, requiring maintaining redundant information in a surprising number of"
8895" places. When you use Argument Clinic, you don't have to repeat yourself."
8996msgstr ""
97+ "Argument Clinic 为了能完成主要目标,用起来必须方便。目前,使用 CPython "
98+ "的参数解析库是一件苦差事,需要在很多地方维护冗余信息。如果使用 Argument Clinic,则不必再重复代码了。"
9099
91100#: ../../howto/clinic.rst:47
92101msgid ""
@@ -100,13 +109,19 @@ msgid ""
100109"argument parsing library. That would make for the fastest argument parsing "
101110"possible!)"
102111msgstr ""
112+ "显然,除非 Argument Clinic 解决了自身的问题,且没有产生新的问题,否则没有人会愿意用它。所以,Argument Clinic "
113+ "最重要的事情就是生成正确的代码。如果能加速代码的运行当然更好,但至少不应引入明显的减速。(最终 Argument Clinic *应该* "
114+ "可以实现较大的速度提升——代码生成器可以重写一下,以产生量身定做的参数解析代码,而不是调用通用的 CPython 参数解析库。 "
115+ "这会让参数解析达到最佳速度!)"
103116
104117#: ../../howto/clinic.rst:59
105118msgid ""
106119"Additionally, Argument Clinic must be flexible enough to work with any "
107120"approach to argument parsing. Python has some functions with some very "
108121"strange parsing behaviors; Argument Clinic's goal is to support all of them."
109122msgstr ""
123+ "此外,Argument Clinic 必须足够灵活,能够与任何参数解析的方法一起工作。Python "
124+ "有一些函数具备一些非常奇怪的解析行为;Argument Clinic 的目标是支持所有这些函数。"
110125
111126#: ../../howto/clinic.rst:64
112127msgid ""
@@ -115,6 +130,8 @@ msgid ""
115130"introspection query functions would throw an exception if you passed in a "
116131"builtin. With Argument Clinic, that's a thing of the past!"
117132msgstr ""
133+ "最后,Argument Clinic 的初衷是为 CPython 内置程序提供内省“签名”。以前如果传入一个内置函数,内省查询函数会抛出异常。有了 "
134+ "Argument Clinic,再不会发生这种问题了!"
118135
119136#: ../../howto/clinic.rst:70
120137msgid ""
@@ -124,23 +141,27 @@ msgid ""
124141" get more sophisticated, and it should be able to do many interesting and "
125142"smart things with all the information you give it."
126143msgstr ""
144+ "在与 Argument Clinic 合作时,应该牢记一个理念:给它的信息越多,它做得就会越好。诚然,Argument Clinic "
145+ "现在还比较简单。但会演变得越来越复杂,应该能够利用给出的全部信息干很多聪明而有趣的事情。"
127146
128147#: ../../howto/clinic.rst:80
129148msgid "Basic Concepts And Usage"
130- msgstr ""
149+ msgstr "基本概念和用法 "
131150
132151#: ../../howto/clinic.rst:82
133152msgid ""
134153"Argument Clinic ships with CPython; you'll find it in "
135154"``Tools/clinic/clinic.py``. If you run that script, specifying a C file as "
136155"an argument:"
137156msgstr ""
157+ "Argument Clinic 与 CPython 一起提供,位于 ``Tools/clinic/clinic.py`` 。若要运行它,请指定一个 C "
158+ "文件作为参数。"
138159
139160#: ../../howto/clinic.rst:89
140161msgid ""
141162"Argument Clinic will scan over the file looking for lines that look exactly "
142163"like this:"
143- msgstr ""
164+ msgstr "Argument Clinic 会扫描 C 文件,精确查找以下代码: "
144165
145166#: ../../howto/clinic.rst:96
146167msgid ""
0 commit comments