Skip to content

Commit 8047ea9

Browse files
committed
feat: translate c-api/refcounting.po
1 parent 6902834 commit 8047ea9

File tree

1 file changed

+43
-22
lines changed

1 file changed

+43
-22
lines changed

c-api/refcounting.po

+43-22
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2022, Python Software Foundation
1+
# Copyright (C) 2001-2023, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
43
#
54
# Translators:
65
# Leon H., 2017
6+
# Matt Wang <mattwang44@gmail.com>, 2023
77
msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.11\n"
1010
"Report-Msgid-Bugs-To: \n"
1111
"POT-Creation-Date: 2022-05-21 17:35+0000\n"
1212
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
13-
"Last-Translator: Leon H.\n"
13+
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1515
"tw)\n"
1616
"Language: zh_TW\n"
@@ -27,52 +27,54 @@ msgstr "參照計數"
2727
msgid ""
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
3333
msgid "Increment the reference count for object *o*."
34-
msgstr ""
34+
msgstr "增加物件 *o* 的參照計數。"
3535

3636
#: ../../c-api/refcounting.rst:18
3737
msgid ""
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
4445
msgid ""
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
5051
msgid ""
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
5657
msgid "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
6061
msgid ""
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
6667
msgid ""
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
7273
msgid ""
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
7880
msgid "For example::"
@@ -94,33 +96,33 @@ msgstr "另請參閱 :c:func:`Py_INCREF`\\ 。"
9496

9597
#: ../../c-api/refcounting.rst:61
9698
msgid "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
100102
msgid "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
104106
msgid "Decrement the reference count for object *o*."
105-
msgstr ""
107+
msgstr "減少物件 *o* 的參照計數。"
106108

107109
#: ../../c-api/refcounting.rst:72
108110
msgid ""
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
114116
msgid ""
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
120122
msgid ""
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
126128
msgid ""
@@ -134,13 +136,21 @@ msgid ""
134136
"update the list data structure, and then call :c:func:`Py_DECREF` for the "
135137
"temporary variable."
136138
msgstr ""
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
139148
msgid ""
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
146156
msgid ""
@@ -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."
153163
msgstr ""
164+
"減少物件 *o* 的參照計數。該物件可能是 ``NULL``,在這種情況下巨集不起作用;否則,"
165+
"效果與 :c:func:`Py_DECREF` 相同,只是引數也設定為 ``NULL``。:c:func:`Py_DECREF "
166+
"的警告不適用於傳遞的物件,"
167+
"因為巨集在遞減其參照計數之前小心地使用臨時變數並將參數設定為 ``NULL``。"
154168

155169
#: ../../c-api/refcounting.rst:109
156170
msgid ""
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
162176
msgid ""
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
168184
msgid ""
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
174192
msgid ""
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`."
178196
msgstr ""
197+
"以下函式或巨集僅在直譯器核心內使用::c:func:`_Py_Dealloc`、:c:func:`_Py_Forge"
198+
"tReference`、:c:func:`_Py_NewReference` 以及全域變數 "
199+
":c:data:`_Py_RefTotal`。"

0 commit comments

Comments
 (0)