Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b01d87c

Browse files
[po] auto sync
1 parent 627c79c commit b01d87c

3 files changed

Lines changed: 34 additions & 8 deletions

File tree

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "89.73%", "updated_at": "2023-08-13T07:56:17Z"}
1+
{"translation": "89.76%", "updated_at": "2023-08-13T08:56:58Z"}

c-api/intro.po

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,12 @@ msgid ""
527527
"said to *borrow* the reference. Nothing needs to be done for a "
528528
":term:`borrowed reference`."
529529
msgstr ""
530+
"Python/C API 中函数的引用计数最好是使用 *引用所有权* 来解释。 所有权是关联到引用,而不是对象(对象不能被拥有:它们总是会被共享)。 "
531+
"“拥有一个引用”意味着当不再需要该引用时必须在其上调用 Py_DECREF。 "
532+
"所有权也可以被转移,这意味着接受该引用所有权的代码在不再需要它时必须通过调用 :c:func:`Py_DECREF` 或 "
533+
":c:func:`Py_XDECREF` 来最终释放它 --- 或是继续转移这个责任(通常是转给其调用方)。 "
534+
"当一个函数将引用所有权转给其调用方时,则称调用方收到一个 *新的* 引用。 当未转移所有权时,则称调用方是 *借入* 这个引用。 对于 "
535+
":term:`borrowed reference` 来说不需要任何额外操作。"
530536

531537
#: ../../c-api/intro.rst:373
532538
msgid ""
@@ -604,6 +610,9 @@ msgid ""
604610
" For example, this function sets all items of a list (actually, any mutable"
605611
" sequence) to a given item::"
606612
msgstr ""
613+
"在对条目使用 :c:func:`PyObject_SetItem` 等操作时更常见的做法是只借入引用,比如将参数传递给你正在编写的函数。 "
614+
"在这种情况下,它们在引用方面的行为更为清晰,因为你不必为了把引用转走而获取一个新的引用(“让它被偷取”)。 "
615+
"例如,这个函数将列表(实际上是任何可变序列)中的所有条目都设为给定的条目::"
607616

608617
#: ../../c-api/intro.rst:452
609618
msgid ""

c-api/refcounting.po

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ msgstr "永生对象不会被修改。"
7979
msgid ""
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
8585
msgid ""
@@ -92,7 +92,7 @@ msgstr ""
9292

9393
#: ../../c-api/refcounting.rst:56
9494
msgid "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
9898
msgid ""
@@ -106,12 +106,14 @@ msgid ""
106106
"`some objects <https://peps.python.org/pep-0683/>`_, this function has no "
107107
"effect."
108108
msgstr ""
109+
"不要预期此函数会以任何方式实际地改变 *o*。 至少对 `某些对象 <https://peps.python.org/pep-0683/>`_ "
110+
"来说,此函数将没有任何效果。"
109111

110112
#: ../../c-api/refcounting.rst:71
111113
msgid ""
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
117119
msgid "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*."
124126
msgstr ""
127+
"为对象创建一个新的 :term:`strong reference`: 在 *o* 上调用 :c:func:`Py_INCREF` 并返回对象 *o*。"
125128

126129
#: ../../c-api/refcounting.rst:82
127130
msgid ""
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
133136
msgid ""
@@ -159,14 +162,16 @@ msgstr "如果对象 *o* 为 ``NULL``,该函数也·将返回 ``NULL``。"
159162
msgid ""
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
165168
msgid ""
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."
169172
msgstr ""
173+
"当最后一个 :term:`strong reference` 被释放时 (即对象的引用计数变为 0),将会发起调用该对象所属类型的 "
174+
"deallocation 函数 (它必须不为 ``NULL``)。"
170175

171176
#: ../../c-api/refcounting.rst:121
172177
msgid ""
@@ -204,6 +209,8 @@ msgid ""
204209
" case this has no effect. The same warning from :c:func:`Py_DECREF` applies "
205210
"here as well."
206211
msgstr ""
212+
"与 :c:func:`Py_DECREF` 类似,但对象 *o* 可以为 ``NULL``,在这种情况下此函数将没有任何效果。 来自 "
213+
":c:func:`Py_DECREF` 的警告同样适用于此处。"
207214

208215
#: ../../c-api/refcounting.rst:155
209216
msgid ""
@@ -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."
216223
msgstr ""
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
219230
msgid ""
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
225236
msgid ""
@@ -233,19 +244,23 @@ msgid ""
233244
"version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic "
234245
"embedding of Python."
235246
msgstr ""
247+
"表示获取一个指向对象 *o* 的新 :term:`strong reference`。 :c:func:`Py_XINCREF` 的函数版本。 "
248+
"它可被用于 Python 的运行时动态嵌入。"
236249

237250
#: ../../c-api/refcounting.rst:180
238251
msgid ""
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."
242255
msgstr ""
256+
"释放一个指向对象 *o* 的 :term:`strong reference`。 :c:func:`Py_XDECREF` 的函数版本。 它可被用于 "
257+
"Python 的运行时动态嵌入。"
243258

244259
#: ../../c-api/refcounting.rst:187
245260
msgid ""
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
251266
msgid "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."
263278
msgstr ""
279+
"这样使得在释放对旧 *dst* 值的引用 _之前_ 将 *dst* 设为 *src*,从而让任何因 *dst* 被去除而触发的代码不再相信 *dst* "
280+
"指向一个有效的对象。"
264281

265282
#: ../../c-api/refcounting.rst:206 ../../c-api/refcounting.rst:218
266283
msgid ""

0 commit comments

Comments
 (0)