@@ -437,6 +437,8 @@ msgid ""
437437"from a :c:func:`Py_DECREF`, so almost any operation is potentially "
438438"dangerous."
439439msgstr ""
440+ "但是,有一个常见的陷阱是从列表中提取一个对象,并将其持有一段时间,而不增加其引用计数。某些操作可能会从列表中删除某个对象,减少其引用计数,并有可能重新分配这个对象。真正的危险是,这个看似无害的操作可能会调用任意"
441+ " Python 代码——也许有一个代码路径允许控制流从 :c:func:`Py_DECREF` 回到用户,因此在复合对象上的操作都存在潜在的风险。"
440442
441443#: ../../c-api/intro.rst:306
442444msgid ""
@@ -447,10 +449,13 @@ msgid ""
447449"call :c:func:`Py_DECREF` when they are done with the result; this soon "
448450"becomes second nature."
449451msgstr ""
452+ "一个安全的方式是始终使用泛型操作(名称以 ``PyObject_`` , ``PyNumber_`` , ``PySequence_`` 或 "
453+ "``PyMapping_`` 开头的函数)。这些操作总是增加它们返回的对象的引用计数。这让调用者有责任在获得结果后调用 "
454+ ":c:func:`Py_DECREF` 。习惯这种方式很简单。"
450455
451456#: ../../c-api/intro.rst:316
452457msgid "Reference Count Details"
453- msgstr ""
458+ msgstr "引用计数细节 "
454459
455460#: ../../c-api/intro.rst:318
456461msgid ""
@@ -671,7 +676,7 @@ msgstr ""
671676
672677#: ../../c-api/intro.rst:591
673678msgid "Here is the corresponding C code, in all its glory::"
674- msgstr ""
679+ msgstr "下面是对应的闪耀荣光的 C 代码: "
675680
676681#: ../../c-api/intro.rst:643
677682msgid ""
@@ -814,7 +819,7 @@ msgstr "额外的检查将添加到解析器和编译器中。"
814819msgid ""
815820"Downcasts from wide types to narrow types are checked for loss of "
816821"information."
817- msgstr ""
822+ msgstr "检查从宽类型向窄类型的向下强转是否损失了信息。 "
818823
819824#: ../../c-api/intro.rst:760
820825msgid ""
@@ -840,7 +845,7 @@ msgstr "添加底层跟踪和额外的异常检查到虚拟机的运行时中。
840845
841846#: ../../c-api/intro.rst:771
842847msgid "Extra checks are added to the memory arena implementation."
843- msgstr ""
848+ msgstr "添加额外的检查到 arena 内存实现。 "
844849
845850#: ../../c-api/intro.rst:773
846851msgid "Extra debugging is added to the thread module."
0 commit comments