@@ -221,6 +221,7 @@ msgid ""
221221"A use for ``Py_UNREACHABLE()`` is following a call a function that never "
222222"returns but that is not declared :c:macro:`_Py_NO_RETURN`."
223223msgstr ""
224+ "``Py_UNREACHABLE()`` 的一个用法是调用一个不会返回,但却没有声明 :c:macro:`_Py_NO_RETURN` 的函数之后。"
224225
225226#: ../../c-api/intro.rst:122
226227msgid ""
@@ -230,6 +231,8 @@ msgid ""
230231"case, it's better to report the error to the caller. If the error cannot be"
231232" reported to caller, :c:func:`Py_FatalError` can be used."
232233msgstr ""
234+ "如果一个代码路径不太可能是正常代码,但在特殊情况下可以到达,就不能使用该宏。例如,在低内存条件下,或者一个系统调用返回超出预期范围值,诸如此类,最好将错误报告给调用者。如果无法将错误报告给调用者,可以使用"
235+ " :c:func:`Py_FatalError` 。"
233236
234237#: ../../c-api/intro.rst:132
235238msgid "Return the absolute value of ``x``."
@@ -266,18 +269,22 @@ msgid ""
266269"Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the "
267270"command line (i.e. if ``Py_IgnoreEnvironmentFlag`` is set)."
268271msgstr ""
272+ "与 ``getenv(s)`` 类似,但是如果命令行上传递了 :option:`-E` ,则返回 ``NULL`` (即如果设置了 "
273+ "``Py_IgnoreEnvironmentFlag`` )。"
269274
270275#: ../../c-api/intro.rst:173
271276msgid ""
272277"Use this for unused arguments in a function definition to silence compiler "
273278"warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``."
274279msgstr ""
280+ "用于函数定义中未使用的参数,从而消除编译器警告。例如: ``int func(int a, int Py_UNUSED(b)) { return a; "
281+ "}`` 。"
275282
276283#: ../../c-api/intro.rst:180
277284msgid ""
278285"Use this for deprecated declarations. The macro must be placed before the "
279286"symbol name."
280- msgstr ""
287+ msgstr "弃用声明。该宏必须放置在符号名称前。 "
281288
282289#: ../../c-api/intro.rst:183 ../../c-api/intro.rst:198
283290#: ../../c-api/intro.rst:216
@@ -286,31 +293,33 @@ msgstr "示例::"
286293
287294#: ../../c-api/intro.rst:187
288295msgid "MSVC support was added."
289- msgstr ""
296+ msgstr "添加了 MSVC 支持。 "
290297
291298#: ../../c-api/intro.rst:192
292299msgid ""
293300"Creates a variable with name ``name`` that can be used in docstrings. If "
294301"Python is built without docstrings, the value will be empty."
295- msgstr ""
302+ msgstr "创建一个可以在文档字符串中使用的,名字为 ``name`` 的变量。如果不和文档字符串一起构建 Python,该值将为空。 "
296303
297304#: ../../c-api/intro.rst:195
298305msgid ""
299306"Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python "
300307"without docstrings, as specified in :pep:`7`."
301308msgstr ""
309+ "如 :pep:`7` 所述,使用 :c:macro:`PyDoc_STRVAR` 作为文档字符串,以支持不和文档字符串一起构建 Python 的情况。"
302310
303311#: ../../c-api/intro.rst:210
304312msgid ""
305313"Creates a docstring for the given input string or an empty string if "
306314"docstrings are disabled."
307- msgstr ""
315+ msgstr "为给定的字符串输入创建一个文档字符串,或者当文档字符串被禁用时,创建一个空字符串。 "
308316
309317#: ../../c-api/intro.rst:213
310318msgid ""
311319"Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python"
312320" without docstrings, as specified in :pep:`7`."
313321msgstr ""
322+ "如 :pep:`7` 所述,使用 :c:macro:`PyDoc_STR` 指定文档字符串,以支持不和文档字符串一起构建 Python 的情况。"
314323
315324#: ../../c-api/intro.rst:227
316325msgid "Objects, Types and Reference Counts"
@@ -330,6 +339,11 @@ msgid ""
330339"objects; since these must never be deallocated, they are typically static "
331340":c:type:`PyTypeObject` objects."
332341msgstr ""
342+ "多数 Python/C API 有一个或多个参数,以及一个 :c:type:`PyObject*` 类型的返回值。这种类型是指向任意 Python "
343+ "对象的不透明数据类型的指针。所有 Python 对象类型在大多数情况下都被 Python "
344+ "语言由相同的方式处理(例如,赋值,作用域规则,和参数传递),因此将它们由单个 C 类型表示才合适。几乎所有 Python "
345+ "对象存放在堆中:你不能声明一个类型为 :c:type:`PyObject` 的自动或静态的变量,只能声明类型为 :c:type:`PyObject*` "
346+ "的指针。type 对象是唯一的例外,因为它们永远不能被释放,所以它们通常是静态的 :c:type:`PyTypeObject` 对象。"
333347
334348#: ../../c-api/intro.rst:242
335349msgid ""
0 commit comments