@@ -79,7 +79,7 @@ msgstr "永生对象不会被修改。"
7979msgid ""
8080"Indicate taking a new :term:`strong reference` to object *o*, indicating it "
8181"is in use and should not be destroyed."
82- msgstr ""
82+ msgstr "表示为对象 *o* 获取一个新的 :term:`strong reference`,指明该对象正在被使用且不应被销毁。 "
8383
8484#: ../../c-api/refcounting.rst:52
8585msgid ""
@@ -92,7 +92,7 @@ msgstr ""
9292
9393#: ../../c-api/refcounting.rst:56
9494msgid "When done using the object, release it by calling :c:func:`Py_DECREF`."
95- msgstr ""
95+ msgstr "当对象使用完毕后,可调用 :c:func:`Py_DECREF` 释放它。 "
9696
9797#: ../../c-api/refcounting.rst:58
9898msgid ""
@@ -106,12 +106,14 @@ msgid ""
106106"`some objects <https://peps.python.org/pep-0683/>`_, this function has no "
107107"effect."
108108msgstr ""
109+ "不要预期此函数会以任何方式实际地改变 *o*。 至少对 `某些对象 <https://peps.python.org/pep-0683/>`_ "
110+ "来说,此函数将没有任何效果。"
109111
110112#: ../../c-api/refcounting.rst:71
111113msgid ""
112114"Similar to :c:func:`Py_INCREF`, but the object *o* can be ``NULL``, in which"
113115" case this has no effect."
114- msgstr ""
116+ msgstr "与 :c:func:`Py_INCREF` 类似,但对象 *o* 可以为 ``NULL``,在这种情况下此函数将没有任何效果。 "
115117
116118#: ../../c-api/refcounting.rst:74
117119msgid "See also :c:func:`Py_XNewRef`."
@@ -122,12 +124,13 @@ msgid ""
122124"Create a new :term:`strong reference` to an object: call :c:func:`Py_INCREF`"
123125" on *o* and return the object *o*."
124126msgstr ""
127+ "为对象创建一个新的 :term:`strong reference`: 在 *o* 上调用 :c:func:`Py_INCREF` 并返回对象 *o*。"
125128
126129#: ../../c-api/refcounting.rst:82
127130msgid ""
128131"When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` "
129132"should be called on it to release the reference."
130- msgstr ""
133+ msgstr "当不再需要这个 :term:`strong reference` 时,应当在其上调用 :c:func:`Py_DECREF` 来释放引用。 "
131134
132135#: ../../c-api/refcounting.rst:85
133136msgid ""
@@ -159,14 +162,16 @@ msgstr "如果对象 *o* 为 ``NULL``,该函数也·将返回 ``NULL``。"
159162msgid ""
160163"Release a :term:`strong reference` to object *o*, indicating the reference "
161164"is no longer used."
162- msgstr ""
165+ msgstr "释放一个指向对象 *o* 的 :term:`strong reference`,表明该引用不再被使用。 "
163166
164167#: ../../c-api/refcounting.rst:116
165168msgid ""
166169"Once the last :term:`strong reference` is released (i.e. the object's "
167170"reference count reaches 0), the object's type's deallocation function (which"
168171" must not be ``NULL``) is invoked."
169172msgstr ""
173+ "当最后一个 :term:`strong reference` 被释放时 (即对象的引用计数变为 0),将会发起调用该对象所属类型的 "
174+ "deallocation 函数 (它必须不为 ``NULL``)。"
170175
171176#: ../../c-api/refcounting.rst:121
172177msgid ""
@@ -204,6 +209,8 @@ msgid ""
204209" case this has no effect. The same warning from :c:func:`Py_DECREF` applies "
205210"here as well."
206211msgstr ""
212+ "与 :c:func:`Py_DECREF` 类似,但对象 *o* 可以为 ``NULL``,在这种情况下此函数将没有任何效果。 来自 "
213+ ":c:func:`Py_DECREF` 的警告同样适用于此处。"
207214
208215#: ../../c-api/refcounting.rst:155
209216msgid ""
@@ -214,12 +221,16 @@ msgid ""
214221"to the object passed because the macro carefully uses a temporary variable "
215222"and sets the argument to ``NULL`` before releasing the reference."
216223msgstr ""
224+ "释放一个指向对象 *o* 的 :term:`strong reference`。 对象可以为 "
225+ "``NULL``,在此情况下该宏将没有任何效果;在其他情况下其效果与 :c:func:`Py_DECREF` 相同,区别在于其参数也会被设为 "
226+ "``NULL``。 针对 :c:func:`Py_DECREF` 的警告不适用于所传递的对象,因为该宏会细心地使用一个临时变量并在释放引用之前将参数设为"
227+ " ``NULL``。"
217228
218229#: ../../c-api/refcounting.rst:163
219230msgid ""
220231"It is a good idea to use this macro whenever releasing a reference to an "
221232"object that might be traversed during garbage collection."
222- msgstr ""
233+ msgstr "当需要释放指向一个在垃圾回收期间可能被会遍历的对象的引用时使用该宏是一个好主意。 "
223234
224235#: ../../c-api/refcounting.rst:166
225236msgid ""
@@ -233,19 +244,23 @@ msgid ""
233244"version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic "
234245"embedding of Python."
235246msgstr ""
247+ "表示获取一个指向对象 *o* 的新 :term:`strong reference`。 :c:func:`Py_XINCREF` 的函数版本。 "
248+ "它可被用于 Python 的运行时动态嵌入。"
236249
237250#: ../../c-api/refcounting.rst:180
238251msgid ""
239252"Release a :term:`strong reference` to object *o*. A function version of "
240253":c:func:`Py_XDECREF`. It can be used for runtime dynamic embedding of "
241254"Python."
242255msgstr ""
256+ "释放一个指向对象 *o* 的 :term:`strong reference`。 :c:func:`Py_XDECREF` 的函数版本。 它可被用于 "
257+ "Python 的运行时动态嵌入。"
243258
244259#: ../../c-api/refcounting.rst:187
245260msgid ""
246261"Macro safely releasing a :term:`strong reference` to object *dst* and "
247262"setting *dst* to *src*."
248- msgstr ""
263+ msgstr "该宏可安全地释放一个指向对象 *dst* 的 :term:`strong reference`,并将 *dst* 设为 *src*。 "
249264
250265#: ../../c-api/refcounting.rst:190
251266msgid "As in case of :c:func:`Py_CLEAR`, \" the obvious\" code can be deadly::"
@@ -261,6 +276,8 @@ msgid ""
261276"old value of *dst*, so that any code triggered as a side-effect of *dst* "
262277"getting torn down no longer believes *dst* points to a valid object."
263278msgstr ""
279+ "这样使得在释放对旧 *dst* 值的引用 _之前_ 将 *dst* 设为 *src*,从而让任何因 *dst* 被去除而触发的代码不再相信 *dst* "
280+ "指向一个有效的对象。"
264281
265282#: ../../c-api/refcounting.rst:206 ../../c-api/refcounting.rst:218
266283msgid ""
0 commit comments