@@ -137,19 +137,23 @@ msgid ""
137137" return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or "
138138":c:func:`PyErr_Occurred` to disambiguate."
139139msgstr ""
140+ "capsule 具有 ``NULL`` 上下文是全法的。 这会使得 ``NULL`` 返回码有些歧义;请使用 "
141+ ":c:func:`PyCapsule_IsValid` 或 :c:func:`PyErr_Occurred` 来消除歧义。"
140142
141143#: ../../c-api/capsule.rst:92
142144msgid ""
143145"Return the current name stored in the capsule. On failure, set an exception"
144146" and return ``NULL``."
145- msgstr ""
147+ msgstr "返回保存在 capsule 中的当前名称。 在失败时设置一个异常并返回 ``NULL``。 "
146148
147149#: ../../c-api/capsule.rst:95
148150msgid ""
149151"It is legal for a capsule to have a ``NULL`` name. This makes a ``NULL`` "
150152"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or "
151153":c:func:`PyErr_Occurred` to disambiguate."
152154msgstr ""
155+ "capsule 具有 ``NULL`` 名称是合法的。 这会使得 ``NULL`` 返回码有些歧义;请使用 "
156+ ":c:func:`PyCapsule_IsValid` 或 :c:func:`PyErr_Occurred` 来消除歧义。"
153157
154158#: ../../c-api/capsule.rst:102
155159msgid ""
@@ -160,12 +164,16 @@ msgid ""
160164"(using :c:func:`PyImport_ImportModuleNoBlock`). If *no_block* is false, "
161165"import the module conventionally (using :c:func:`PyImport_ImportModule`)."
162166msgstr ""
167+ "从一个模块的 capsule 属性导入指向 C 对象的指针。 *name* 形参应当指定属性的完整名称,与 ``module.attribute`` "
168+ "中的一致。 保存在 capsule 中的 *name* 必须完全匹配此字符串。 如果 *no_block* 为真值,则以无阻塞模式导入模块 (使用 "
169+ ":c:func:`PyImport_ImportModuleNoBlock`)。 如果 *no_block* 为假值,则以传统模式导入模块 (使用 "
170+ ":c:func:`PyImport_ImportModule`)。"
163171
164172#: ../../c-api/capsule.rst:109
165173msgid ""
166174"Return the capsule's internal *pointer* on success. On failure, set an "
167175"exception and return ``NULL``."
168- msgstr ""
176+ msgstr "成功时返回 capsule 的内部 *指针*。 在失败时设置一个异常并返回 ``NULL``。 "
169177
170178#: ../../c-api/capsule.rst:115
171179msgid ""
@@ -175,43 +183,50 @@ msgid ""
175183"(See :c:func:`PyCapsule_GetPointer` for information on how capsule names are"
176184" compared.)"
177185msgstr ""
186+ "确定 *capsule* 是否是一个有效的。 有效的 capsule 必须不为 ``NULL``,传递 "
187+ ":c:func:`PyCapsule_CheckExact`,在其中存储一个不为 ``NULL`` 的指针,并且其内部名称与 *name* 形参相匹配。"
188+ " (请参阅 :c:func:`PyCapsule_GetPointer` 了解如何对 capsule 名称进行比较的有关信息。)"
178189
179190#: ../../c-api/capsule.rst:121
180191msgid ""
181192"In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls "
182193"to any of the accessors (any function starting with :c:func:`PyCapsule_Get`)"
183194" are guaranteed to succeed."
184195msgstr ""
196+ "换句话说,如果 :c:func:`PyCapsule_IsValid` 返回真值,则任何对访问器(以 :c:func:`PyCapsule_Get` "
197+ "开头的任何函数)的调用都保证会成功。"
185198
186199#: ../../c-api/capsule.rst:125
187200msgid ""
188201"Return a nonzero value if the object is valid and matches the name passed "
189202"in. Return ``0`` otherwise. This function will not fail."
190- msgstr ""
203+ msgstr "如果对象有效并且匹配传入的名称则返回非零值。 否则返回 ``0``。 此函数一定不会失败。 "
191204
192205#: ../../c-api/capsule.rst:131
193206msgid "Set the context pointer inside *capsule* to *context*."
194- msgstr ""
207+ msgstr "将 *capsule* 内部的上下文指针设为 *context*。 "
195208
196209#: ../../c-api/capsule.rst:133 ../../c-api/capsule.rst:140
197210#: ../../c-api/capsule.rst:149 ../../c-api/capsule.rst:157
198211msgid ""
199212"Return ``0`` on success. Return nonzero and set an exception on failure."
200- msgstr ""
213+ msgstr "成功时返回 ``0``。 失败时返回非零值并设置一个异常。 "
201214
202215#: ../../c-api/capsule.rst:138
203216msgid "Set the destructor inside *capsule* to *destructor*."
204- msgstr ""
217+ msgstr "将 *capsule* 内部的析构器设为 *destructor*。 "
205218
206219#: ../../c-api/capsule.rst:145
207220msgid ""
208221"Set the name inside *capsule* to *name*. If non-``NULL``, the name must "
209222"outlive the capsule. If the previous *name* stored in the capsule was not "
210223"``NULL``, no attempt is made to free it."
211224msgstr ""
225+ "将 *capsule* 内部的名称设为 *name*。 如果不为 ``NULL``,则名称的存在期必须比 capsule 更长。 如果之前保存在 "
226+ "capsule 中的 *name* 不为 ``NULL``,则不会尝试释放它。"
212227
213228#: ../../c-api/capsule.rst:154
214229msgid ""
215230"Set the void pointer inside *capsule* to *pointer*. The pointer may not be "
216231"``NULL``."
217- msgstr ""
232+ msgstr "将 *capsule* 内部的空指针设为 *pointer*。 指针不可为 ``NULL``。 "
0 commit comments