@@ -76,25 +76,29 @@ msgid ""
7676"If non-``NULL``, this string must outlive the capsule. (Though it is "
7777"permitted to free it inside the *destructor*.)"
7878msgstr ""
79+ "字符串 *name* 可以是 ``NULL`` 或是一个指向有效的 C 字符串的指针。 如果不为 ``NULL``,则此字符串必须比 capsule "
80+ "长(虽然也允许在 *destructor* 中释放它。)"
7981
8082#: ../../c-api/capsule.rst:51
8183msgid ""
8284"If the *destructor* argument is not ``NULL``, it will be called with the "
8385"capsule as its argument when it is destroyed."
84- msgstr ""
86+ msgstr "如果 *destructor* 参数不为 ``NULL``,则当它被销毁时将附带 capsule 作为参数来调用。 "
8587
8688#: ../../c-api/capsule.rst:54
8789msgid ""
8890"If this capsule will be stored as an attribute of a module, the *name* "
8991"should be specified as ``modulename.attributename``. This will enable other"
9092" modules to import the capsule using :c:func:`PyCapsule_Import`."
9193msgstr ""
94+ "如果此 capsule 将被保存为一个模块的属性,则 *name* 应当被指定为 ``modulename.attributename``。 "
95+ "这将允许其他模块使用 :c:func:`PyCapsule_Import` 来导入此 capsule。"
9296
9397#: ../../c-api/capsule.rst:61
9498msgid ""
9599"Retrieve the *pointer* stored in the capsule. On failure, set an exception "
96100"and return ``NULL``."
97- msgstr ""
101+ msgstr "提取保存在 capsule 中的 *pointer*。 在失败时设置一个异常并返回 ``NULL``。 "
98102
99103#: ../../c-api/capsule.rst:64
100104msgid ""
@@ -103,25 +107,29 @@ msgid ""
103107"also be ``NULL``. Python uses the C function :c:func:`strcmp` to compare "
104108"capsule names."
105109msgstr ""
110+ "*name* 形参必须与保存在 capsule 中的名称进行精确比较。 如果保存在 capsule 中的名称为 ``NULL``,则传入的 *name*"
111+ " 也必须为 ``NULL``。 Python 会使用 C 函数 :c:func:`strcmp` 来比较 capsule 名称。"
106112
107113#: ../../c-api/capsule.rst:72
108114msgid ""
109115"Return the current destructor stored in the capsule. On failure, set an "
110116"exception and return ``NULL``."
111- msgstr ""
117+ msgstr "返回保存在 capsule 中的当前析构器。 在失败时设置一个异常并返回 ``NULL``。 "
112118
113119#: ../../c-api/capsule.rst:75
114120msgid ""
115121"It is legal for a capsule to have a ``NULL`` destructor. This makes a "
116122"``NULL`` return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or "
117123":c:func:`PyErr_Occurred` to disambiguate."
118124msgstr ""
125+ "具有 ``NULL`` 析构器是合法的。 这会使得 ``NULL`` 返回值有些歧义;请使用 :c:func:`PyCapsule_IsValid` 或"
126+ " :c:func:`PyErr_Occurred` 来消除歧义。"
119127
120128#: ../../c-api/capsule.rst:82
121129msgid ""
122130"Return the current context stored in the capsule. On failure, set an "
123131"exception and return ``NULL``."
124- msgstr ""
132+ msgstr "返回保存在 capsule 中的当前上下文。 在失败时设置一个异常并返回 ``NULL``。 "
125133
126134#: ../../c-api/capsule.rst:85
127135msgid ""
0 commit comments