@@ -27,52 +27,54 @@ msgstr "參照計數"
2727msgid ""
2828"The macros in this section are used for managing reference counts of Python "
2929"objects."
30- msgstr ""
30+ msgstr "本節中的巨集用於管理 Python 物件的參照計數。 "
3131
3232#: ../../c-api/refcounting.rst:16
3333msgid "Increment the reference count for object *o*."
34- msgstr ""
34+ msgstr "增加物件 *o* 的參照計數。 "
3535
3636#: ../../c-api/refcounting.rst:18
3737msgid ""
3838"This function is usually used to convert a :term:`borrowed reference` to a :"
3939"term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be "
4040"used to create a new :term:`strong reference`."
41- msgstr ""
41+ msgstr "此函式通常用於將\\ :term:`借用參照 <borrowed reference>`\\ 原地 (in-place) 轉換為\\ :term:`強參照 <strong reference>`。:c:func:`Py_NewRef` "
42+ "函式可用於建立新的\\ :term:`強參照 <strong reference>`。"
4243
4344#: ../../c-api/refcounting.rst:22
4445msgid ""
4546"The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, "
4647"use :c:func:`Py_XINCREF`."
47- msgstr ""
48+ msgstr "該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請使用 :c:func:`Py_XINCREF`。 "
4849
4950#: ../../c-api/refcounting.rst:28
5051msgid ""
5152"Increment the reference count for object *o*. The object may be ``NULL``, "
5253"in which case the macro has no effect."
53- msgstr ""
54+ msgstr "增加物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用。 "
5455
5556#: ../../c-api/refcounting.rst:31
5657msgid "See also :c:func:`Py_XNewRef`."
57- msgstr "另請見 :c:func:`Py_XNewRef`\\ 。"
58+ msgstr "另請見 :c:func:`Py_XNewRef`。"
5859
5960#: ../../c-api/refcounting.rst:36
6061msgid ""
6162"Create a new :term:`strong reference` to an object: increment the reference "
6263"count of the object *o* and return the object *o*."
63- msgstr ""
64+ msgstr "建立對物件的新 \\ :term:`強參照 <strong reference>`:增加物件 *o* 的參照計數並回傳物件 *o*。 "
6465
6566#: ../../c-api/refcounting.rst:39
6667msgid ""
6768"When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` "
6869"should be called on it to decrement the object reference count."
69- msgstr ""
70+ msgstr "當不再需要 \\ :term:`強參照 <strong reference>` \\ 時,應對其呼叫 :c:func:`Py_DECREF` 以減少物件參照計數。 "
7071
7172#: ../../c-api/refcounting.rst:42
7273msgid ""
7374"The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be "
7475"``NULL``."
75- msgstr ""
76+ msgstr "物件 *o* 不能為 ``NULL``;如果 *o* 可以為 "
77+ "``NULL``,則使用 :c:func:`Py_XNewRef`。"
7678
7779#: ../../c-api/refcounting.rst:45
7880msgid "For example::"
@@ -94,33 +96,33 @@ msgstr "另請參閱 :c:func:`Py_INCREF`\\ 。"
9496
9597#: ../../c-api/refcounting.rst:61
9698msgid "Similar to :c:func:`Py_NewRef`, but the object *o* can be NULL."
97- msgstr ""
99+ msgstr "與 :c:func:`Py_NewRef` 類似,但物件 *o* 可以為 NULL。 "
98100
99101#: ../../c-api/refcounting.rst:63
100102msgid "If the object *o* is ``NULL``, the function just returns ``NULL``."
101- msgstr ""
103+ msgstr "如果物件 *o* 為 ``NULL``,則該函式僅回傳 ``NULL``。 "
102104
103105#: ../../c-api/refcounting.rst:70
104106msgid "Decrement the reference count for object *o*."
105- msgstr ""
107+ msgstr "減少物件 *o* 的參照計數。 "
106108
107109#: ../../c-api/refcounting.rst:72
108110msgid ""
109111"If the reference count reaches zero, the object's type's deallocation "
110112"function (which must not be ``NULL``) is invoked."
111- msgstr ""
113+ msgstr "如果參照計數達到零,則調用物件之型別的釋放函式 (deallocation function)(不得為 ``NULL``)。 "
112114
113115#: ../../c-api/refcounting.rst:75
114116msgid ""
115117"This function is usually used to delete a :term:`strong reference` before "
116118"exiting its scope."
117- msgstr ""
119+ msgstr "此函式通常用於在退出作用域之前刪除 \\ :term:`強參照 <strong reference>`。 "
118120
119121#: ../../c-api/refcounting.rst:78
120122msgid ""
121123"The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, "
122124"use :c:func:`Py_XDECREF`."
123- msgstr ""
125+ msgstr "該物件不能為 ``NULL``;如果你不確定它不是 ``NULL``,請改用 :c:func:`Py_XDECREF`。 "
124126
125127#: ../../c-api/refcounting.rst:83
126128msgid ""
@@ -134,13 +136,21 @@ msgid ""
134136"update the list data structure, and then call :c:func:`Py_DECREF` for the "
135137"temporary variable."
136138msgstr ""
139+ "釋放函式可以導致任意 Python 程式碼被調用(例如,當釋放具有 :meth:`__del__` "
140+ "方法的類別實例時)。雖然此類程式碼中的例外不會被傳遞出來,但"
141+ "執行的程式碼可以自由存取所有 Python 全域變數。這意味著在調用 :c:"
142+ "func:`Py_DECREF` 之前,"
143+ "可從全域變數存取的任何物件都應處於一致狀態。例如,從 list 中刪除物件的程式碼應"
144+ "將已刪除物件的參照複製到臨時變數中,更新 list 資料結構,然後為臨時變數呼叫 "
145+ ":c:func:`Py_DECREF`。"
137146
138147#: ../../c-api/refcounting.rst:95
139148msgid ""
140149"Decrement the reference count for object *o*. The object may be ``NULL``, "
141150"in which case the macro has no effect; otherwise the effect is the same as "
142151"for :c:func:`Py_DECREF`, and the same warning applies."
143- msgstr ""
152+ msgstr "減少物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用;"
153+ "否則效果與 :c:func:`Py_DECREF` 相同,且使得應用了相同的警告。"
144154
145155#: ../../c-api/refcounting.rst:102
146156msgid ""
@@ -151,28 +161,39 @@ msgid ""
151161"object passed because the macro carefully uses a temporary variable and sets "
152162"the argument to ``NULL`` before decrementing its reference count."
153163msgstr ""
164+ "減少物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用;否則,"
165+ "效果與 :c:func:`Py_DECREF` 相同,只是引數也設定為 ``NULL``。:c:func:`Py_DECREF "
166+ "的警告不適用於傳遞的物件,"
167+ "因為巨集在遞減其參照計數之前小心地使用臨時變數並將參數設定為 ``NULL``。"
154168
155169#: ../../c-api/refcounting.rst:109
156170msgid ""
157171"It is a good idea to use this macro whenever decrementing the reference "
158172"count of an object that might be traversed during garbage collection."
159- msgstr ""
173+ msgstr "每當要減少垃圾收集期間可能被遍歷到之物件的參照計數時,使用此巨集是個好主意。 "
160174
161175#: ../../c-api/refcounting.rst:114
162176msgid ""
163177"Increment the reference count for object *o*. A function version of :c:func:"
164178"`Py_XINCREF`. It can be used for runtime dynamic embedding of Python."
165- msgstr ""
179+ msgstr "增加物件 *o* 的參照計數。:c:func:"
180+ "`Py_XINCREF` "
181+ "的函式版本。它可用於 Python 的執行環境動態嵌入。"
166182
167183#: ../../c-api/refcounting.rst:120
168184msgid ""
169185"Decrement the reference count for object *o*. A function version of :c:func:"
170186"`Py_XDECREF`. It can be used for runtime dynamic embedding of Python."
171- msgstr ""
187+ msgstr "減少物件 *o* 的參照計數。:c:func:"
188+ "`Py_XDECREF` "
189+ "的函式版本。它可用於 Python 的執行環境動態嵌入。"
172190
173191#: ../../c-api/refcounting.rst:124
174192msgid ""
175193"The following functions or macros are only for use within the interpreter "
176194"core: :c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:"
177195"`_Py_NewReference`, as well as the global variable :c:data:`_Py_RefTotal`."
178196msgstr ""
197+ "以下函式或巨集僅在直譯器核心內使用::c:func:`_Py_Dealloc`、:c:func:`_Py_Forge"
198+ "tReference`、:c:func:`_Py_NewReference` 以及全域變數 "
199+ ":c:data:`_Py_RefTotal`。"