Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions c-api/bytes.po
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ msgid ""
"\"stolen\", the value of *\\*bytes* will be set to ``NULL``, and the "
"appropriate exception will be set."
msgstr ""
"在 *\\*bytes* 中建立一個新的 bytes 物件,其內容為 *newpart* 附加到 *bytes* 之"
"後的結果;呼叫者將擁有新的參照。*bytes* 舊值的參照將被「:term:`竊取 "
"<steal>`」。如果無法建立新物件,*bytes* 的舊參照仍將被「竊取」,*\\*bytes* 的"
"值將被設為 ``NULL``,並會設定適當的例外。"

#: ../../c-api/bytes.rst:190 ../../c-api/bytes.rst:200
msgid ""
Expand Down
3 changes: 3 additions & 0 deletions c-api/dict.po
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ msgid ""
"on success or ``-1`` on failure. This function *does not* \":term:`steal`\" "
"a reference to *val*."
msgstr ""
"以 *key* 為鍵,將 *val* 插入至字典 *p* 中。*key* 必須是\\ :term:`可雜湊的 "
"<hashable>`,否則將引發 :exc:`TypeError`。成功時回傳 ``0``,失敗時回傳 "
"``-1``。此函式\\ *不會*\\ 「:term:`竊取 <steal>`」對 *val* 的參照。"

#: ../../c-api/dict.rst:103
msgid ""
Expand Down
13 changes: 13 additions & 0 deletions c-api/exceptions.po
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ msgid ""
"This call \":term:`steals <steal>`\" a reference to *exc*, which must be a "
"valid exception."
msgstr ""
"此呼叫「:term:`竊取 <steal>`」對 *exc* 的參照,*exc* 必須為一個有效的例外。"

#: ../../c-api/exceptions.rst:516
msgid "Use :c:func:`PyErr_GetRaisedException` instead."
Expand Down Expand Up @@ -699,6 +700,10 @@ msgid ""
"arguments. This function is kept for backwards compatibility. Prefer using :"
"c:func:`PyErr_SetHandledException`."
msgstr ""
"設定例外資訊,如同從 ``sys.exc_info()`` 得知的資訊一般。這裡指的是一個 *已經"
"被捕捉* 的例外,而不是剛被引發的例外。此函式「:term:`竊取 <steal>`」這些引數"
"的參照。若要清除例外狀態,請為所有三個引數傳入 ``NULL``。此函式是為了向後相容"
"而保留,建議改用 :c:func:`PyErr_SetHandledException`。"

#: ../../c-api/exceptions.rst:653
msgid ""
Expand All @@ -715,6 +720,9 @@ msgid ""
"argument). The function still \":term:`steals <steal>`\" references of all "
"three arguments."
msgstr ""
"引數 ``type`` 和 ``traceback`` 已不再使用,可以為 NULL。直譯器現在會從例外實"
"例(引數 ``value``)中衍生出它們。此函式仍會「:term:`竊取 <steal>`」所有三個"
"引數的參照。"

#: ../../c-api/exceptions.rst:668
msgid "Signal Handling"
Expand Down Expand Up @@ -933,6 +941,8 @@ msgid ""
"clear it. There is no type check to make sure that *ctx* is an exception "
"instance. This \":term:`steals <steal>`\" a reference to *ctx*."
msgstr ""
"將與該例外關聯的情境設定為 *ctx*。使用 ``NULL`` 來清除它。這裡不會檢查型別以"
"確保 *ctx* 是一個例外實例。此函式「:term:`竊取 <steal>`」對 *ctx* 的參照。"

#: ../../c-api/exceptions.rst:861
msgid ""
Expand All @@ -949,6 +959,9 @@ msgid ""
"exception instance or ``None``. This \":term:`steals <steal>`\" a reference "
"to *cause*."
msgstr ""
"將與該例外關聯的成因設定為 *cause*。使用 ``NULL`` 來清除它。這裡不會檢查型別"
"以確保 *cause* 是一個例外實例或 ``None``。此函式「:term:`竊取 <steal>`」對 "
"*cause* 的參照。"

#: ../../c-api/exceptions.rst:874
msgid ""
Expand Down
15 changes: 7 additions & 8 deletions c-api/gen.po
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,25 @@ msgstr ""
"此函式總是會成功執行。"

#: ../../c-api/gen.rst:37
#, fuzzy
msgid ""
"Create and return a new generator object based on the *frame* object. A "
"reference to *frame* is \":term:`stolen <steal>`\" by this function (even on "
"error). The argument must not be ``NULL``."
msgstr ""
"基於 *frame* 物件建立並回傳一個新的產生器物件。此函式會取走一個對 *frame* 的"
"參照 (reference)。引數必須不為 ``NULL``。"
"基於 *frame* 物件建立並回傳一個新的產生器物件。此函式會「:term:`竊取 "
"<steal>`」對 *frame* 的一個參照(即使發生錯誤也一樣)。引數必須不為 "
"``NULL``。"

#: ../../c-api/gen.rst:43
#, fuzzy
msgid ""
"Create and return a new generator object based on the *frame* object, with "
"``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference "
"to *frame* is \":term:`stolen <steal>`\" by this function (even on error). "
"The *frame* argument must not be ``NULL``."
msgstr ""
"基於 *frame* 物件建立並回傳一個新的產生器物件,其中 ``__name__`` 和 "
"``__qualname__`` 設為 *name* 和 *qualname*。此函式會取走一個對 *frame* 的參"
"。*frame* 引數必須不為 ``NULL``。"
"``__qualname__`` 設為 *name* 和 *qualname*。此函式會「:term:`竊取 <steal>`」"
"對 *frame* 的一個參照(即使發生錯誤也一樣)。*frame* 引數必須不為 ``NULL``。"

#: ../../c-api/gen.rst:51
msgid ""
Expand All @@ -107,14 +106,14 @@ msgstr ""
"AsyncGeneratorType` 使用。"

#: ../../c-api/gen.rst:70
#, fuzzy
msgid ""
"Create a new asynchronous generator wrapping *frame*, with ``__name__`` and "
"``__qualname__`` set to *name* and *qualname*. *frame* is \":term:`stolen "
"<steal>`\" by this function (even on error) and must not be ``NULL``."
msgstr ""
"建立一個包裝 *frame* 的非同步產生器,並將 ``__name__`` 和 ``__qualname__`` 設"
"為 *name* 和 *qualname*。*frame* 會被此函式取走,且不得為 ``NULL``。"
"為 *name* 和 *qualname*。*frame* 會被此函式「:term:`竊取 <steal>`」(即使發生"
"錯誤也一樣),且不得為 ``NULL``。"

#: ../../c-api/gen.rst:75
msgid ""
Expand Down
2 changes: 2 additions & 0 deletions c-api/init_config.po
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,8 @@ msgid ""
"The function now replaces :data:`sys.flags` (create a new object), instead "
"of modifying :data:`sys.flags` in-place."
msgstr ""
"此函式現在會取代 :data:`sys.flags`\\(建立新物件),而非原地修改 :data:`sys."
"flags`。"

#: ../../c-api/init_config.rst:634
msgid "PyConfig C API"
Expand Down
9 changes: 5 additions & 4 deletions c-api/intro.po
Original file line number Diff line number Diff line change
Expand Up @@ -987,15 +987,13 @@ msgstr ""
"照 <borrowed reference>`\\ 就不需要做任何事情。"

#: ../../c-api/intro.rst:642
#, fuzzy
msgid ""
"Conversely, when a calling function passes in a reference to an object, "
"there are two possibilities: the function *steals* a reference to the "
"object, or it does not."
msgstr ""
"相反地,當呼叫的函式傳入物件的參照時,有兩種可能性:函式有\\ *竊取 (steal)* "
"物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定"
"它現在擁有該參照,並且你不再對它負責。"
"相反地,當呼叫的函式傳入物件的參照時,有兩種可能性:函式\\ *竊取 (steal)*\\ "
"物件的參照,或者沒有。"

#: ../../c-api/intro.rst:646
msgid ""
Expand All @@ -1004,6 +1002,9 @@ msgid ""
"can use :c:func:`!Py_DECREF` at its discretion, you (the caller) must not "
"use that reference after the call."
msgstr ""
"*竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定它現在擁有該參照。由於新"
"的擁有者可以自行決定何時呼叫 :c:func:`!Py_DECREF`,你(呼叫者)在呼叫之後就不"
"可以再使用該參照。"

#: ../../c-api/intro.rst:655
msgid ""
Expand Down
11 changes: 5 additions & 6 deletions c-api/list.po
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ msgstr ""
"出邊界範圍則回傳 ``-1`` 並設定一個 :exc:`IndexError` 例外。"

#: ../../c-api/list.rst:105
#, fuzzy
msgid ""
"This function \":term:`steals <steal>`\" a reference to *item*, even on "
"error. On success, it discards a reference to an item already in the list at "
"the affected position (unless it was ``NULL``)."
msgstr ""
"此函式「竊取」對 *item* 的參照,並丟棄對串列中受影響位置上已存在項目的參照。"
"此函式「:term:`竊取 <steal>`」對 *item* 的參照,即使發生錯誤也一樣。成功時,"
"它會丟棄串列中受影響位置上已存在項目的參照(除非該項目為 ``NULL``)。"

#: ../../c-api/list.rst:113
msgid ""
Expand All @@ -149,15 +149,14 @@ msgstr ""
"查。"

#: ../../c-api/list.rst:122
#, fuzzy
msgid ""
"This macro \":term:`steals <steal>`\" a reference to *item*, and, unlike :c:"
"func:`PyList_SetItem`, does *not* discard a reference to any item that is "
"being replaced; any reference in *list* at position *i* will be leaked."
msgstr ""
"該巨集「竊取」對 *item* 的參照,並且與 :c:func:`PyList_SetItem` 不同的是,它"
"\\ *不會*\\ 丟棄對任意被替換項目的參照;*list* 中位置 *i* 的任何參照都將被洩"
" (leak)。"
"該巨集「:term:`竊取 <steal>`」對 *item* 的參照,並且與 :c:func:"
"`PyList_SetItem` 不同的是,它\\ *不會*\\ 丟棄對任意被替換項目的參照;*list* "
"中位置 *i* 的任何參照都將被洩漏 (leak)。"

#: ../../c-api/list.rst:129
msgid ""
Expand Down
12 changes: 12 additions & 0 deletions c-api/memory.po
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ msgid ""
"in the previous example, the allocated memory for the I/O buffer completely "
"escapes the Python memory manager."
msgstr ""
"然而,在大多數情況下,建議從 Python 堆積分配記憶體,這是因為 Python 堆積是由 "
"Python 記憶體管理器所控制的。舉例來說,當直譯器被以 C 撰寫的新物件型別擴充"
"時,就必須這樣做。使用 Python 堆積的另一個理由,是希望能\\ *告知*\\ Python 記"
"憶體管理器該擴充模組的記憶體需求。即使所請求的記憶體僅用於內部、高度特定的用"
"途,將所有記憶體請求都委託給 Python 記憶體管理器,也能讓直譯器對其整體的記憶"
"體使用狀況有更準確的掌握。因此,在某些情況下,Python 記憶體管理器可能會(或可"
"能不會)觸發適當的動作,例如垃圾回收、記憶體壓縮或其他預防性程序。請注意,如"
"同前面範例所示,若使用 C 函式庫的分配器,配置給 I/O 緩衝區的記憶體會完全逃脫 "
"Python 記憶體管理器的掌控。"

#: ../../c-api/memory.rst:88
msgid ""
Expand Down Expand Up @@ -226,6 +235,9 @@ msgid ""
"of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the request "
"fails. The memory is initialized to zeros."
msgstr ""
"分配 *nelem* 個元素,每個元素大小為 *elsize* 個位元組,並回傳一個型別為 :c:"
"expr:`void*` 的指標指向所分配的記憶體;如果請求失敗則回傳 ``NULL``。這塊記憶"
"體會被初始化為零。"

#: ../../c-api/memory.rst:168
msgid ""
Expand Down
8 changes: 5 additions & 3 deletions c-api/module.po
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@ msgid ""
"function that returns a new reference without bothering to check its result "
"or even saving it to a variable."
msgstr ""
"類似於 :c:func:`PyModule_AddObjectRef`,但會「:term:`竊取 <steal>`」對 "
"*value* 的參照(即使發生錯誤也一樣)。它可以搭配某個回傳新參照之函式的結果來"
"呼叫,而不需要費心檢查其結果,甚至不需要將其儲存到變數中。"

#: ../../c-api/module.rst:569
msgid ""
Expand All @@ -663,13 +666,12 @@ msgstr ""
"}"

#: ../../c-api/module.rst:578
#, fuzzy
msgid ""
"Similar to :c:func:`PyModule_AddObjectRef`, but :term:`steals <steal>` a "
"reference to *value* on success (if it returns ``0``)."
msgstr ""
"類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會偷走對 "
"*value* 的參照。"
"類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會\\ :"
"term:`竊取 <steal>`\\ 對 *value* 的參照。"

#: ../../c-api/module.rst:581
msgid ""
Expand Down
3 changes: 3 additions & 0 deletions c-api/sequence.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ msgid ""
"of the Python statement ``o[i] = v``. This function *does not* \":term:"
"`steal`\" a reference to *v*."
msgstr ""
"將物件 *v* 指定給 *o* 的第 *i* 個元素。失敗時引發例外並回傳 ``-1``;成功時回"
"傳 ``0``。這相當於 Python 陳述式 ``o[i] = v``。此函式\\ *不會*\\ 「:term:`竊"
"取 <steal>`」對 *v* 的參照。"

#: ../../c-api/sequence.rst:72
msgid ""
Expand Down
6 changes: 6 additions & 0 deletions c-api/threads.po
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,12 @@ msgid ""
"isn't found. If *exc* is ``NULL``, the pending exception (if any) for the "
"thread is cleared. This raises no exceptions."
msgstr ""
"非同步地在執行緒中引發例外。*id* 引數為目標執行緒的執行緒 id;*exc* 為要引發"
"的例外物件。此函式不會\\ :term:`竊取 <steal>`\\ 任何對 *exc* 的參照。為了防止"
"不當誤用,你必須自行編寫 C 擴充來呼叫此函式。呼叫時必須具有\\ :term:`已附加的"
"執行緒狀態 <attached thread state>`\\ 。回傳被修改的執行緒狀態數量;通常為"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"執行緒狀態 <attached thread state>`\\ 。回傳被修改的執行緒狀態數量;通常為"
"執行緒狀態 <attached thread state>`。回傳被修改的執行緒狀態數量;通常為"

"一,但若找不到該執行緒 id 則為零。如果 *exc* 為 ``NULL``,則會清除該執行緒的"
"待處理例外(如果有的話)。此函式不會引發任何例外。"

#: ../../c-api/threads.rst:750
msgid ""
Expand Down
14 changes: 7 additions & 7 deletions c-api/tuple.po
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ msgstr ""
"*pos* 超出邊界則回傳 ``-1``,並設定 :exc:`IndexError` 例外。"

#: ../../c-api/tuple.rst:93
#, fuzzy
msgid ""
"This function \":term:`steals <steal>`\" a reference to *o* and discards a "
"reference to an item already in the tuple at the affected position (unless "
"it was NULL)."
msgstr "此函式 \"竊取\" 對 *o* 的參照,並丟棄對元組中受影響位置的項目的參照。"
msgstr ""
"此函式「:term:`竊取 <steal>`」對 *o* 的參照,並丟棄元組中該受影響位置上已存在"
"項目的參照(除非該參照為 NULL)。"

#: ../../c-api/tuple.rst:100
msgid ""
Expand All @@ -153,14 +154,14 @@ msgstr ""
"with-assertions>` 建置,則會進行作為斷言(asserting)的邊界檢查。"

#: ../../c-api/tuple.rst:108
#, fuzzy
msgid ""
"This function \":term:`steals <steal>`\" a reference to *o*, and, unlike :c:"
"func:`PyTuple_SetItem`, does *not* discard a reference to any item that is "
"being replaced; any reference in the tuple at position *pos* will be leaked."
msgstr ""
"此函式 \"竊取\" 對 *o* 的參照,且與 :c:func:`PyTuple_SetItem` 不同的是,此函"
"式並 *不* 丟棄任何被替代項目的參照;元組中 *pos* 位置的所有參照皆會被洩漏。"
"此函式「:term:`竊取 <steal>`」對 *o* 的參照,且與 :c:func:`PyTuple_SetItem` "
"不同的是,此函式並\\ *不*\\ 丟棄任何被替換項目的參照;元組中 *pos* 位置的所有"
"參照皆會被洩漏。"

#: ../../c-api/tuple.rst:115
msgid ""
Expand Down Expand Up @@ -319,9 +320,8 @@ msgstr ""
"`PyTuple_SET_ITEM` 類似,此函式僅套用於填充全新實例。"

#: ../../c-api/tuple.rst:248
#, fuzzy
msgid "This function \":term:`steals <steal>`\" a reference to *o*."
msgstr "此函式 \"竊取\" *o* 的參照。"
msgstr "此函式「:term:`竊取 <steal>`」對 *o* 的參照。"

#: ../../c-api/tuple.rst:253
msgid "Alias to :c:func:`PyStructSequence_SetItem`."
Expand Down
2 changes: 1 addition & 1 deletion c-api/type.po
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ msgstr ""
msgid ""
"The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize` is "
"zero)."
msgstr ""
msgstr "基底並非大小可變的(其 :c:member:`~PyTypeObject.tp_itemsize` 為零)。"

#: ../../c-api/type.rst:555
msgid ""
Expand Down
10 changes: 9 additions & 1 deletion c-api/typeobj.po
Original file line number Diff line number Diff line change
Expand Up @@ -4289,6 +4289,8 @@ msgid ""
"Check if the request can be met. If not, raise :exc:`BufferError`, set "
"``view->obj`` to ``NULL`` and return ``-1``."
msgstr ""
"檢查該請求是否能夠被滿足。如果不能,則引發 :exc:`BufferError`,將 ``view-"
">obj`` 設為 ``NULL`` 並回傳 ``-1``。"

#: ../../c-api/typeobj.rst:3050
msgid "Fill in the requested fields."
Expand All @@ -4300,7 +4302,7 @@ msgstr ""

#: ../../c-api/typeobj.rst:3054
msgid "Set ``view->obj`` to *exporter* and increment ``view->obj``."
msgstr ""
msgstr "將 ``view->obj`` 設為 *exporter*,並遞增 ``view->obj``。"

#: ../../c-api/typeobj.rst:3056
msgid "Return ``0``."
Expand Down Expand Up @@ -4352,12 +4354,16 @@ msgid ""
"Re-export: Each member of the tree acts as the exporting object and sets "
"``view->obj`` to a new reference to itself."
msgstr ""
"重新匯出:樹狀結構中的每個成員都作為匯出物件,並將 ``view->obj`` 設為指向自身"
"的新參照。"

#: ../../c-api/typeobj.rst:3082
msgid ""
"Redirect: The buffer request is redirected to the root object of the tree. "
"Here, ``view->obj`` will be a new reference to the root object."
msgstr ""
"重新導向:緩衝區請求會被重新導向至樹狀結構的根物件。在這種情況下,``view-"
">obj`` 將會是指向該根物件的新參照。"

#: ../../c-api/typeobj.rst:3086
msgid ""
Expand Down Expand Up @@ -4437,6 +4443,8 @@ msgid ""
"automatically in :c:func:`PyBuffer_Release` (this scheme is useful for "
"breaking reference cycles)."
msgstr ""
"此函式絕不能遞減 ``view->obj``,因為這會由 :c:func:`PyBuffer_Release` 自動完"
"成(此機制有助於打破循環參照)。"

#: ../../c-api/typeobj.rst:3142
msgid ""
Expand Down
3 changes: 3 additions & 0 deletions c-api/unicode.po
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,9 @@ msgid ""
"term:`strong reference` to a Unicode object; :c:func:`!PyUnicode_Append` "
"releases (\":term:`steals <steal>`\") this reference."
msgstr ""
"將字串 *right* 附加到 *p_left* 的結尾。*p_left* 必須指向一個 Unicode 物件的"
"\\ :term:`強參照 <strong reference>`;:c:func:`!PyUnicode_Append` 會釋放(「:"
"term:`竊取 <steal>`」)此參照。"

#: ../../c-api/unicode.rst:669
msgid "On error, set *\\*p_left* to ``NULL`` and set an exception."
Expand Down
10 changes: 10 additions & 0 deletions c-api/weakref.po
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ msgid ""
"weakly referenceable object, this will raise :exc:`TypeError` and return "
"``NULL``."
msgstr ""
"回傳物件 *ob* 的弱參照物件。這總是會回傳一個新參照,但不保證會建立一個新物"
"件;也可能會回傳一個已存在的參照物件。第二個參數 *callback* 可以是一個可呼叫"
"物件,會在 *ob* 被垃圾回收時收到通知;它應該接受一個參數,也就是該弱參照物件"
"本身。*callback* 也可以是 ``None`` 或 ``NULL``。如果 *ob* 不是可被弱參照的物"
"件,則會引發 :exc:`TypeError` 並回傳 ``NULL``。"

#: ../../c-api/weakref.rst:49 ../../c-api/weakref.rst:65
msgid ""
Expand All @@ -82,6 +87,11 @@ msgid ""
"*ob* weakly referenceable object, this will raise :exc:`TypeError` and "
"return ``NULL``."
msgstr ""
"回傳物件 *ob* 的弱參照代理物件。這總是會回傳一個新參照,但不保證會建立一個新"
"物件;也可能會回傳一個已存在的代理物件。第二個參數 *callback* 可以是一個可呼"
"叫物件,會在 *ob* 被垃圾回收時收到通知;它應該接受一個參數,也就是該弱參照物"
"件本身。*callback* 也可以是 ``None`` 或 ``NULL``。如果 *ob* 不是可被弱參照的"
"物件,則會引發 :exc:`TypeError` 並回傳 ``NULL``。"

#: ../../c-api/weakref.rst:71
msgid ""
Expand Down
Loading