@@ -382,6 +382,10 @@ msgid ""
382382"guarantees to hold a reference to every argument for the duration of the "
383383"call."
384384msgstr ""
385+ "没有必要为每个包含指向对象的指针的局部变量增加对象的引用计数。理论上,当变量指向对象时,对象的引用计数增加 1 ,当变量超出范围时,对象的引用计数减少 "
386+ "1 "
387+ "。但是,这两者相互抵消,所以最后引用计数没有改变。使用引用计数的唯一真正原因是只要我们的变量指向它,就可以防止对象被释放。如果知道至少有一个对该对象的其他引用存活时间至少和我们的变量一样长,则没必要临时增加引用计数。一个典型的情形是,对象作为参数从"
388+ " Python 中传递给被调用的扩展模块中的 C 函数时,调用机制会保证在调用期间持有对所有参数的引用。"
385389
386390#: ../../c-api/intro.rst:273
387391msgid ""
@@ -404,10 +408,13 @@ msgid ""
404408"call :c:func:`Py_DECREF` when they are done with the result; this soon "
405409"becomes second nature."
406410msgstr ""
411+ "一个安全的方式是始终使用泛型操作(名称以 ``PyObject_`` , ``PyNumber_`` , ``PySequence_`` 或 "
412+ "``PyMapping_`` 开头的函数)。这些操作总是增加它们返回的对象的引用计数。这让调用者有责任在获得结果后调用 "
413+ ":c:func:`Py_DECREF` 。习惯这种方式很简单。"
407414
408415#: ../../c-api/intro.rst:291
409416msgid "Reference Count Details"
410- msgstr ""
417+ msgstr "引用计数细节 "
411418
412419#: ../../c-api/intro.rst:293
413420msgid ""
@@ -628,7 +635,7 @@ msgstr ""
628635
629636#: ../../c-api/intro.rst:566
630637msgid "Here is the corresponding C code, in all its glory::"
631- msgstr ""
638+ msgstr "下面是对应的闪耀荣光的 C 代码: "
632639
633640#: ../../c-api/intro.rst:618
634641msgid ""
@@ -771,7 +778,7 @@ msgstr "额外的检查将添加到解析器和编译器中。"
771778msgid ""
772779"Downcasts from wide types to narrow types are checked for loss of "
773780"information."
774- msgstr ""
781+ msgstr "检查从宽类型向窄类型的向下强转是否损失了信息。 "
775782
776783#: ../../c-api/intro.rst:735
777784msgid ""
@@ -797,7 +804,7 @@ msgstr "添加底层跟踪和额外的异常检查到虚拟机的运行时中。
797804
798805#: ../../c-api/intro.rst:746
799806msgid "Extra checks are added to the memory arena implementation."
800- msgstr ""
807+ msgstr "添加额外的检查到 arena 内存实现。 "
801808
802809#: ../../c-api/intro.rst:748
803810msgid "Extra debugging is added to the thread module."
0 commit comments