From 311dcdaeedd4bf708292c5a9d1fc4187549b52f7 Mon Sep 17 00:00:00 2001 From: allen91wu Date: Sat, 18 Dec 2021 14:06:11 +0800 Subject: [PATCH 1/7] Translate `library/queue.po` --- library/queue.po | 114 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 14 deletions(-) diff --git a/library/queue.po b/library/queue.po index 740dbf576a..e054600a5d 100644 --- a/library/queue.po +++ b/library/queue.po @@ -3,13 +3,16 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Adrian Liaw , 2018 +# Allen Wu , 2021 +# msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-05-23 16:08+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2021-12-18 19:14+0800\n" +"Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,10 +20,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.0.1\n" #: ../../library/queue.rst:2 msgid ":mod:`queue` --- A synchronized queue class" -msgstr "" +msgstr ":mod:`queue` --- 同步佇列 (quene) class(類別)" #: ../../library/queue.rst:7 msgid "**Source code:** :source:`Lib/queue.py`" @@ -33,6 +37,9 @@ msgid "" "exchanged safely between multiple threads. The :class:`Queue` class in this " "module implements all the required locking semantics." msgstr "" +":mod:`queue` 模組實作多生產者、多消費者佇列。在執行緒程式設計中,必須在多執行" +"緒之間安全地交換資訊時,特別有用。此 module 中的 :class:`Queue` class 實作所" +"有必需的鎖定語義 (Semantics)。" #: ../../library/queue.rst:16 msgid "" @@ -44,6 +51,11 @@ msgid "" "sorted (using the :mod:`heapq` module) and the lowest valued entry is " "retrieved first." msgstr "" +"此 module 實作三種型別的佇列,它們僅在取出條目的順序上有所不同。在 :abbr:" +"`FIFO (first-in, first-out)` 佇列中,先加入的任務是第一個被取出的。在 :abbr:" +"`LIFO (last-in, first-out)` 佇列中,最近被加入的條目是第一個被取出的(像堆疊 " +"(stack) 一樣操作)。使用優先佇列時,條目將保持排序狀態(使用 :mod:`heapq` " +"module),並先取出最低值條目。" #: ../../library/queue.rst:24 msgid "" @@ -51,6 +63,8 @@ msgid "" "competing threads; however, they are not designed to handle reentrancy " "within a thread." msgstr "" +"在內部,這三種型別的佇列使用鎖來臨時鎖定競爭執行緒;但是,它們並不是被設計來" +"處理執行緒內的 reentrancy(可重入)。" #: ../../library/queue.rst:28 msgid "" @@ -58,10 +72,12 @@ msgid "" "out)` queue type, :class:`SimpleQueue`, whose specific implementation " "provides additional guarantees in exchange for the smaller functionality." msgstr "" +"此外,此 module 實作一個「簡單」的 :abbr:`FIFO (first-in, first-out)` 佇列型" +"別 :class:`SimpleQueue`,其明確的實作提供了額外的保證,以換取較小的功能。" #: ../../library/queue.rst:33 msgid "The :mod:`queue` module defines the following classes and exceptions:" -msgstr "" +msgstr ":mod:`queue` module 定義了以下的 class 和例外:" #: ../../library/queue.rst:37 msgid "" @@ -71,6 +87,9 @@ msgid "" "until queue items are consumed. If *maxsize* is less than or equal to zero, " "the queue size is infinite." msgstr "" +":abbr:`FIFO (first-in, first-out)` 佇列的建構子 (constructor)。*maxsize* 是一" +"個整數,用於設置佇列中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,直" +"到佇列中的項目被消耗完。如果 *maxsize* 小於或等於零,則佇列大小為無限。" #: ../../library/queue.rst:45 msgid "" @@ -80,6 +99,9 @@ msgid "" "until queue items are consumed. If *maxsize* is less than or equal to zero, " "the queue size is infinite." msgstr "" +"`LIFO (last-in, first-out)` 佇列的建構子。*maxsize* 是一個整數,用於設置佇列" +"中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,直到佇列中的項目被消耗" +"完。如果 *maxsize* 小於或等於零,則佇列大小為無限。" #: ../../library/queue.rst:54 msgid "" @@ -89,6 +111,9 @@ msgid "" "consumed. If *maxsize* is less than or equal to zero, the queue size is " "infinite." msgstr "" +"優先佇列的建構子。*maxsize* 是一個整數,用於設置佇列中可放置的項目數的上限。" +"一旦達到此大小,插入將被鎖定,直到佇列中的項目被消耗完。如果 *maxsize* 小於或" +"等於零,則佇列大小為無限。" #: ../../library/queue.rst:59 msgid "" @@ -96,40 +121,54 @@ msgid "" "the one returned by ``sorted(list(entries))[0]``). A typical pattern for " "entries is a tuple in the form: ``(priority_number, data)``." msgstr "" +"首先取出最低值的條目(最低值的條目是 ``sorted(list(entries))[0]`` 回傳的)。" +"條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple。" #: ../../library/queue.rst:63 msgid "" "If the *data* elements are not comparable, the data can be wrapped in a " "class that ignores the data item and only compares the priority number::" msgstr "" +"如果 *data* 元素為不可比較的,則可以將資料包裝在一個 class 中,該類忽略資料項" +"目並僅比較優先數:\n" +"\n" +"::" #: ../../library/queue.rst:76 msgid "" "Constructor for an unbounded :abbr:`FIFO (first-in, first-out)` queue. " "Simple queues lack advanced functionality such as task tracking." msgstr "" +"無界的 :abbr:`FIFO (first-in, first-out)` 佇列的建構子。簡單佇列缺少任務追蹤" +"等進階功能。" #: ../../library/queue.rst:84 msgid "" "Exception raised when non-blocking :meth:`~Queue.get` (or :meth:`~Queue." "get_nowait`) is called on a :class:`Queue` object which is empty." msgstr "" +"當對一個空的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.get`\\ (或 :meth:" +"`~Queue.get_nowait`\\ )將引發例外。" #: ../../library/queue.rst:91 msgid "" "Exception raised when non-blocking :meth:`~Queue.put` (or :meth:`~Queue." "put_nowait`) is called on a :class:`Queue` object which is full." msgstr "" +"當對一個已滿的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.put`\\ (或 :" +"meth:`~Queue.put_nowait`)將引發例外。" #: ../../library/queue.rst:99 msgid "Queue Objects" -msgstr "" +msgstr "佇列物件" #: ../../library/queue.rst:101 msgid "" "Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:" "`PriorityQueue`) provide the public methods described below." msgstr "" +"佇列物件(\\ :class:`Queue`\\ 、\\ :class:`LifoQueue`\\ 、\\ :class:" +"`PriorityQueue`\\ )提供下面描述的公開方法。" #: ../../library/queue.rst:107 msgid "" @@ -137,6 +176,8 @@ msgid "" "guarantee that a subsequent get() will not block, nor will qsize() < maxsize " "guarantee that put() will not block." msgstr "" +"回傳佇列的近似大小。注意,qsize() > 0 並不能保證後續的 get() 不會阻塞," +"qsize() < maxsize 也不會保證 put() 不會阻塞。" #: ../../library/queue.rst:114 msgid "" @@ -145,6 +186,9 @@ msgid "" "not block. Similarly, if empty() returns ``False`` it doesn't guarantee " "that a subsequent call to get() will not block." msgstr "" +"如果佇列為空,則回傳``True``,否則返回 ``False``。如果 empty() 回傳 " +"``True``,則不保證後續呼叫 put() 不會阻塞。同樣,如果 empty() 回傳 " +"``False``,則不保證後續呼叫 get() 不會阻塞。" #: ../../library/queue.rst:122 msgid "" @@ -153,6 +197,9 @@ msgid "" "not block. Similarly, if full() returns ``False`` it doesn't guarantee that " "a subsequent call to put() will not block." msgstr "" +"如果佇列已滿,則回傳``True`` ,否則返回 ``False``。如果 full() 回傳 " +"``True``,則不保證後續呼叫 get() 不會阻塞。同樣,如果 full() 傳回 ``False``," +"則不保證後續呼叫 put() 不會阻塞。" #: ../../library/queue.rst:130 msgid "" @@ -164,10 +211,15 @@ msgid "" "is immediately available, else raise the :exc:`Full` exception (*timeout* is " "ignored in that case)." msgstr "" +"將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 ``None``" +"\\ (預設值),則在必要時阻塞,直到自由槽可用。如果 *timeout* 為正數,則最多" +"阻塞 *timeout* 秒,如果該時間內沒有可用槽,則會引發 :exc:`Full` 例外。否則" +"(*block* 為 false),如果自由槽立即可用,則將項目放在佇列中,否則引發 :exc:" +"`Full` 例外(*在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:141 msgid "Equivalent to ``put(item, False)``." -msgstr "" +msgstr "等效於 ``put(item, False)``。" #: ../../library/queue.rst:146 msgid "" @@ -179,6 +231,11 @@ msgid "" "immediately available, else raise the :exc:`Empty` exception (*timeout* is " "ignored in that case)." msgstr "" +"從佇列中刪除並返回專案。如果可選的 args *block* 為 true,並且 *timeout* 為" +"\"None\"(預設值),則在必要時阻塞,直到項目可用。如果 *timeout* 是正數,則最" +"多會阻止 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:`Empty` 例" +"外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引發 :exc:" +"`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:153 msgid "" @@ -188,16 +245,21 @@ msgid "" "can occur, and in particular a SIGINT will not trigger a :exc:" "`KeyboardInterrupt`." msgstr "" +"在 POSIX 系統上的 3.0 之前,對於 Windows 上的所有版本,如果 *block* 為 true " +"且 *timeout* 為\"None\",則此操作將在底層鎖上進入不間斷等待。這意味著不會發生" +"例外,特別是 SIGINT(中斷訊號)不會觸發 :exc:`KeyboardInterrupt`\\ 。" #: ../../library/queue.rst:161 ../../library/queue.rst:268 msgid "Equivalent to ``get(False)``." -msgstr "" +msgstr "等效於 ``get(False)``。" #: ../../library/queue.rst:163 msgid "" "Two methods are offered to support tracking whether enqueued tasks have been " "fully processed by daemon consumer threads." msgstr "" +"提供了兩種方法來支援追蹤放入佇列的任務是否已由常駐使用者執行緒 (daemon " +"consumer threads) 完全處理。" #: ../../library/queue.rst:169 msgid "" @@ -205,6 +267,8 @@ msgid "" "threads. For each :meth:`get` used to fetch a task, a subsequent call to :" "meth:`task_done` tells the queue that the processing on the task is complete." msgstr "" +"指示以前放入佇列的任務已完成。由佇列使用者執行緒使用。對於用於獲取任務的每" +"個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。" #: ../../library/queue.rst:173 msgid "" @@ -212,16 +276,18 @@ msgid "" "been processed (meaning that a :meth:`task_done` call was received for every " "item that had been :meth:`put` into the queue)." msgstr "" +"如果目前 :meth:`join` 阻塞,則當所有項目都已處理完畢後,它將恢復(這意味著對" +"於 :meth:`put` 已進入佇列的每個項目,都收到 :meth:`task_done` 的呼叫)。" #: ../../library/queue.rst:177 msgid "" "Raises a :exc:`ValueError` if called more times than there were items placed " "in the queue." -msgstr "" +msgstr "如果呼叫次數超過佇列中放置的項目,則引發 :exc:`ValueError`\\ 。" #: ../../library/queue.rst:183 msgid "Blocks until all items in the queue have been gotten and processed." -msgstr "" +msgstr "阻塞直到佇列中的所有項目都已獲取並處理完畢。" #: ../../library/queue.rst:185 msgid "" @@ -231,25 +297,32 @@ msgid "" "complete. When the count of unfinished tasks drops to zero, :meth:`join` " "unblocks." msgstr "" +"每當項目被加到佇列中時,未完成任務的計數都會增加。每當使用者執行緒呼叫 :meth:" +"`task_done` 以指示該項目已被取出並且對其的所有工作都已完成時,計數就會下降。" +"當未完成任務的計數降至零時,:meth:`join` 將停止阻塞。" #: ../../library/queue.rst:191 msgid "Example of how to wait for enqueued tasks to be completed::" msgstr "" +"如何等待放入佇列的任務完成的範例:\n" +"\n" +"::" #: ../../library/queue.rst:218 msgid "SimpleQueue Objects" -msgstr "SimpleQueue 物件" +msgstr "簡單佇列物件" #: ../../library/queue.rst:220 msgid "" ":class:`SimpleQueue` objects provide the public methods described below." -msgstr "" +msgstr ":class:`SimpleQueue` 物件提供下面描述的公開方法。" #: ../../library/queue.rst:224 msgid "" "Return the approximate size of the queue. Note, qsize() > 0 doesn't " "guarantee that a subsequent get() will not block." msgstr "" +"傳回佇列的近似大小。注意,qsize() > 0 並不能保證後續的 get() 不會阻塞。" #: ../../library/queue.rst:230 msgid "" @@ -257,6 +330,8 @@ msgid "" "returns ``False`` it doesn't guarantee that a subsequent call to get() will " "not block." msgstr "" +"如果佇列為空,則回傳 ``True``,否則回傳 ``False``。如果 empty() 回傳 " +"``False``,則不保證後續呼叫 get() 不會阻塞。" #: ../../library/queue.rst:237 msgid "" @@ -265,12 +340,15 @@ msgid "" "The optional args *block* and *timeout* are ignored and only provided for " "compatibility with :meth:`Queue.put`." msgstr "" +"將 *item* 放入佇列中。該方法從不阻塞,並且都會成功(潛在的初階錯誤,像是分配" +"記憶體失敗除外)。可選的 args *block* 和 *timeout* 將被忽略,並且僅用於與 :" +"meth:`Queue.put` 相容。" #: ../../library/queue.rst:252 msgid "" "Equivalent to ``put(item)``, provided for compatibility with :meth:`Queue." "put_nowait`." -msgstr "" +msgstr "等效於 ``put(item)``,用於與 :meth:`Queue.put_nowait` 相容。" #: ../../library/queue.rst:258 msgid "" @@ -282,16 +360,21 @@ msgid "" "immediately available, else raise the :exc:`Empty` exception (*timeout* is " "ignored in that case)." msgstr "" +"從佇列中刪除並傳回項目。如果可選的 args *block* 為 true,並且 *timeout* 為" +"\"None\"(預設值),則在必要時阻塞,直到項目可用。如果 *timeout* 是正數,則最" +"多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:`Empty` 例" +"外。否則(*block* 為 false),如果立即可用,則傳回一個項目,否則引發 :exc:" +"`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:275 msgid "Class :class:`multiprocessing.Queue`" -msgstr ":class:`multiprocessing.Queue` 類型" +msgstr "Class :class:`multiprocessing.Queue`" #: ../../library/queue.rst:274 msgid "" "A queue class for use in a multi-processing (rather than multi-threading) " "context." -msgstr "" +msgstr "用於多工(而非多執行緒)上下文的佇列 class。" #: ../../library/queue.rst:277 msgid "" @@ -300,3 +383,6 @@ msgid "" "`~collections.deque.popleft` operations that do not require locking and also " "support indexing." msgstr "" +":class:`collections.deque` 是無界佇列的替代實作,具有快速原子 :meth:" +"`~collections.deque.append` 和 :meth:`~collections.deque.popleft` 操作,這些" +"操作不需要鎖定,並且還支持索引。" From 1088bad7ae5af20270a4329f718382f9d47bc654 Mon Sep 17 00:00:00 2001 From: allen91wu Date: Sat, 24 Sep 2022 14:37:46 +0800 Subject: [PATCH 2/7] Translate `library/queue.po` --- library/queue.po | 117 ++++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/library/queue.po b/library/queue.po index 502552a3ca..661fb8dc59 100644 --- a/library/queue.po +++ b/library/queue.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-04-15 00:13+0000\n" -"PO-Revision-Date: 2021-12-18 19:14+0800\n" +"PO-Revision-Date: 2022-09-24 14:29+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -24,7 +24,7 @@ msgstr "" #: ../../library/queue.rst:2 msgid ":mod:`queue` --- A synchronized queue class" -msgstr ":mod:`queue` --- 同步佇列 (quene) class(類別)" +msgstr ":mod:`queue` --- 同步佇列 (queue) class(類別)" #: ../../library/queue.rst:7 msgid "**Source code:** :source:`Lib/queue.py`" @@ -37,9 +37,9 @@ msgid "" "exchanged safely between multiple threads. The :class:`Queue` class in this " "module implements all the required locking semantics." msgstr "" -":mod:`queue` 模組實作多生產者、多消費者佇列。在執行緒程式設計中,必須在多執行" -"緒之間安全地交換資訊時,特別有用。此 module 中的 :class:`Queue` class 實作所" -"有必需的鎖定語義 (Semantics)。" +":mod:`queue` module(模組)實作多生產者、多消費者佇列。在執行緒程式設計中,必" +"須在多執行緒之間安全地交換資訊時,特別有用。此 module 中的 :class:`Queue` " +"class 實作所有必需的鎖定語義 (locking semantics)。" #: ../../library/queue.rst:16 msgid "" @@ -54,8 +54,8 @@ msgstr "" "此 module 實作三種型別的佇列,它們僅在取出條目的順序上有所不同。在 :abbr:" "`FIFO (first-in, first-out)` 佇列中,先加入的任務是第一個被取出的。在 :abbr:" "`LIFO (last-in, first-out)` 佇列中,最近被加入的條目是第一個被取出的(像堆疊 " -"(stack) 一樣操作)。使用優先佇列時,條目將保持排序狀態(使用 :mod:`heapq` " -"module),並先取出最低值條目。" +"(stack) 一樣操作)。使用優先佇列 (priority queue) 時,條目將保持排序狀態(使" +"用 :mod:`heapq` module),並先取出最低值條目。" #: ../../library/queue.rst:24 msgid "" @@ -63,8 +63,8 @@ msgid "" "competing threads; however, they are not designed to handle reentrancy " "within a thread." msgstr "" -"在內部,這三種型別的佇列使用鎖來臨時鎖定競爭執行緒;但是,它們並不是被設計來" -"處理執行緒內的 reentrancy(可重入)。" +"在內部,這三種型別的佇列使用鎖 (lock) 來暫時阻塞競爭執行緒;但是,它們並不是" +"被設計來處理執行緒內的 reentrancy(可重入)。" #: ../../library/queue.rst:28 msgid "" @@ -73,7 +73,7 @@ msgid "" "provides additional guarantees in exchange for the smaller functionality." msgstr "" "此外,此 module 實作一個「簡單」的 :abbr:`FIFO (first-in, first-out)` 佇列型" -"別 :class:`SimpleQueue`,其明確的實作提供了額外的保證,以換取較小的功能。" +"別 :class:`SimpleQueue`,其特定的實作是以較少的功能為代價,來提供額外的保證。" #: ../../library/queue.rst:33 msgid "The :mod:`queue` module defines the following classes and exceptions:" @@ -88,7 +88,7 @@ msgid "" "the queue size is infinite." msgstr "" ":abbr:`FIFO (first-in, first-out)` 佇列的建構子 (constructor)。*maxsize* 是一" -"個整數,用於設置佇列中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,直" +"個整數,用於設置佇列中可放置的項目數的上限。一旦達到此大小,插入將會阻塞,直" "到佇列中的項目被消耗完。如果 *maxsize* 小於或等於零,則佇列大小為無限。" #: ../../library/queue.rst:45 @@ -100,8 +100,8 @@ msgid "" "the queue size is infinite." msgstr "" "`LIFO (last-in, first-out)` 佇列的建構子。*maxsize* 是一個整數,用於設置佇列" -"中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,直到佇列中的項目被消耗" -"完。如果 *maxsize* 小於或等於零,則佇列大小為無限。" +"中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,到佇列中的項目被消耗。" +"如果 *maxsize* 小於或等於零,則佇列大小為無限。" #: ../../library/queue.rst:54 msgid "" @@ -112,8 +112,8 @@ msgid "" "infinite." msgstr "" "優先佇列的建構子。*maxsize* 是一個整數,用於設置佇列中可放置的項目數的上限。" -"一旦達到此大小,插入將被鎖定,直到佇列中的項目被消耗完。如果 *maxsize* 小於或" -"等於零,則佇列大小為無限。" +"一旦達到此大小,插入將被阻塞,直到佇列中的項目被消耗。如果 *maxsize* 小於或等" +"於零,則佇列大小為無限。" #: ../../library/queue.rst:59 msgid "" @@ -121,16 +121,16 @@ msgid "" "the one returned by ``sorted(list(entries))[0]``). A typical pattern for " "entries is a tuple in the form: ``(priority_number, data)``." msgstr "" -"首先取出最低值的條目(最低值的條目是 ``sorted(list(entries))[0]`` 回傳的)。" -"條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple。" +"最低值的條目會最先被取出(最低值的條目是被 ``sorted(list(entries))[0]`` 回傳" +"的)。條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple(元組)。" #: ../../library/queue.rst:63 msgid "" "If the *data* elements are not comparable, the data can be wrapped in a " "class that ignores the data item and only compares the priority number::" msgstr "" -"如果 *data* 元素為不可比較的,則可以將資料包裝在一個 class 中,該類忽略資料項" -"目並僅比較優先數:\n" +"如果 *data* 元素為不可比較的,則可以將資料包裝在一個 class 中,該 class 忽略" +"資料項目並僅比較優先數:\n" "\n" "::" @@ -147,8 +147,8 @@ msgid "" "Exception raised when non-blocking :meth:`~Queue.get` (or :meth:`~Queue." "get_nowait`) is called on a :class:`Queue` object which is empty." msgstr "" -"當對一個空的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.get`\\ (或 :meth:" -"`~Queue.get_nowait`\\ )將引發例外。" +"當對一個空的 :class:`Queue` 物件呼叫非阻塞的 (non-blocking) :meth:`~Queue." +"get`\\ (或 :meth:`~Queue.get_nowait`\\ )將引發此例外。" #: ../../library/queue.rst:91 msgid "" @@ -156,7 +156,7 @@ msgid "" "put_nowait`) is called on a :class:`Queue` object which is full." msgstr "" "當對一個已滿的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.put`\\ (或 :" -"meth:`~Queue.put_nowait`)將引發例外。" +"meth:`~Queue.put_nowait`)將引發此例外。" #: ../../library/queue.rst:99 msgid "Queue Objects" @@ -168,7 +168,7 @@ msgid "" "`PriorityQueue`) provide the public methods described below." msgstr "" "佇列物件(\\ :class:`Queue`\\ 、\\ :class:`LifoQueue`\\ 、\\ :class:" -"`PriorityQueue`\\ )提供下面描述的公開方法。" +"`PriorityQueue`\\ )提供下面描述的公用 method。" #: ../../library/queue.rst:107 msgid "" @@ -186,7 +186,7 @@ msgid "" "not block. Similarly, if empty() returns ``False`` it doesn't guarantee " "that a subsequent call to get() will not block." msgstr "" -"如果佇列為空,則回傳``True``,否則返回 ``False``。如果 empty() 回傳 " +"如果佇列為空,則回傳 ``True``,否則回傳 ``False``。如果 empty() 回傳 " "``True``,則不保證後續呼叫 put() 不會阻塞。同樣,如果 empty() 回傳 " "``False``,則不保證後續呼叫 get() 不會阻塞。" @@ -197,8 +197,8 @@ msgid "" "not block. Similarly, if full() returns ``False`` it doesn't guarantee that " "a subsequent call to put() will not block." msgstr "" -"如果佇列已滿,則回傳``True`` ,否則返回 ``False``。如果 full() 回傳 " -"``True``,則不保證後續呼叫 get() 不會阻塞。同樣,如果 full() 傳回 ``False``," +"如果佇列已滿,則回傳 ``True`` ,否則回傳 ``False``。如果 full() 回傳 " +"``True``,則不保證後續呼叫 get() 不會阻塞。同樣,如果 full() 回傳 ``False``," "則不保證後續呼叫 put() 不會阻塞。" #: ../../library/queue.rst:130 @@ -212,10 +212,10 @@ msgid "" "ignored in that case)." msgstr "" "將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 ``None``" -"\\ (預設值),則在必要時阻塞,直到自由槽可用。如果 *timeout* 為正數,則最多" -"阻塞 *timeout* 秒,如果該時間內沒有可用槽,則會引發 :exc:`Full` 例外。否則" -"(*block* 為 false),如果自由槽立即可用,則將項目放在佇列中,否則引發 :exc:" -"`Full` 例外(*在這種情況下,*timeout* 將被忽略)。" +"\\ (預設值),則在必要時阻塞,直到自由槽 (free slot) 可用。如果 *timeout* 為" +"正數,則最多阻塞 *timeout* 秒,如果該時間內沒有可用的自由槽,則會引發 :exc:" +"`Full` 例外。否則(*block* 為 false),如果自由槽立即可用,則將項目放在佇列" +"中,否則引發 :exc:`Full` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:141 msgid "Equivalent to ``put(item, block=False)``." @@ -231,11 +231,11 @@ msgid "" "immediately available, else raise the :exc:`Empty` exception (*timeout* is " "ignored in that case)." msgstr "" -"從佇列中刪除並返回專案。如果可選的 args *block* 為 true,並且 *timeout* 為" -"\"None\"(預設值),則在必要時阻塞,直到項目可用。如果 *timeout* 是正數,則最" -"多會阻止 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:`Empty` 例" -"外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引發 :exc:" -"`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" +"從佇列中移除並回傳一個項目。如果可選的 args *block* 為 true,且 *timeout* 為 " +"``None``\\(預設值),則在必要時阻塞,直到有可用的項目。如果 *timeout* 是正" +"數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:" +"`Empty` 例外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引" +"發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:153 msgid "" @@ -245,9 +245,9 @@ msgid "" "can occur, and in particular a SIGINT will not trigger a :exc:" "`KeyboardInterrupt`." msgstr "" -"在 POSIX 系統上的 3.0 之前,對於 Windows 上的所有版本,如果 *block* 為 true " -"且 *timeout* 為\"None\",則此操作將在底層鎖上進入不間斷等待。這意味著不會發生" -"例外,特別是 SIGINT(中斷訊號)不會觸發 :exc:`KeyboardInterrupt`\\ 。" +"在 POSIX 系統的 3.0 版之前,以及 Windows 的所有版本,如果 *block* 為 true 且 " +"*timeout* 為 ``None``,則此操作將在底層鎖上進入不間斷等待。這意味著不會發生例" +"外,特別是 SIGINT(中斷訊號)不會觸發 :exc:`KeyboardInterrupt`\\ 。" #: ../../library/queue.rst:161 ../../library/queue.rst:268 msgid "Equivalent to ``get(False)``." @@ -258,7 +258,7 @@ msgid "" "Two methods are offered to support tracking whether enqueued tasks have been " "fully processed by daemon consumer threads." msgstr "" -"提供了兩種方法來支援追蹤放入佇列的任務是否已由常駐使用者執行緒 (daemon " +"有兩個 method 可以支援追蹤放入佇列的任務是否已由常駐消費者執行緒 (daemon " "consumer threads) 完全處理。" #: ../../library/queue.rst:169 @@ -267,8 +267,8 @@ msgid "" "threads. For each :meth:`get` used to fetch a task, a subsequent call to :" "meth:`task_done` tells the queue that the processing on the task is complete." msgstr "" -"指示以前放入佇列的任務已完成。由佇列使用者執行緒使用。對於用於獲取任務的每" -"個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。" +"指示指示先前放入佇列的任務已完成。由佇列消費者執行緒使用。對於用來提取任務的" +"每個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。" #: ../../library/queue.rst:173 msgid "" @@ -283,11 +283,11 @@ msgstr "" msgid "" "Raises a :exc:`ValueError` if called more times than there were items placed " "in the queue." -msgstr "如果呼叫次數超過佇列中放置的項目,則引發 :exc:`ValueError`\\ 。" +msgstr "如果呼叫次數超過佇列中放置的項目數量,則引發 :exc:`ValueError`\\ 。" #: ../../library/queue.rst:183 msgid "Blocks until all items in the queue have been gotten and processed." -msgstr "阻塞直到佇列中的所有項目都已獲取並處理完畢。" +msgstr "持續阻塞直到佇列中的所有項目都已被獲取並處理完畢。" #: ../../library/queue.rst:185 msgid "" @@ -297,7 +297,7 @@ msgid "" "complete. When the count of unfinished tasks drops to zero, :meth:`join` " "unblocks." msgstr "" -"每當項目被加到佇列中時,未完成任務的計數都會增加。每當使用者執行緒呼叫 :meth:" +"每當項目被加到佇列中時,未完成任務的計數都會增加。每當消費者執行緒呼叫 :meth:" "`task_done` 以指示該項目已被取出並且對其的所有工作都已完成時,計數就會下降。" "當未完成任務的計數降至零時,:meth:`join` 將停止阻塞。" @@ -310,12 +310,12 @@ msgstr "" #: ../../library/queue.rst:218 msgid "SimpleQueue Objects" -msgstr "簡單佇列物件" +msgstr "SimpleQueue 物件" #: ../../library/queue.rst:220 msgid "" ":class:`SimpleQueue` objects provide the public methods described below." -msgstr ":class:`SimpleQueue` 物件提供下面描述的公開方法。" +msgstr ":class:`SimpleQueue` 物件提供下面描述的公用 method。" #: ../../library/queue.rst:224 msgid "" @@ -340,15 +340,16 @@ msgid "" "The optional args *block* and *timeout* are ignored and only provided for " "compatibility with :meth:`Queue.put`." msgstr "" -"將 *item* 放入佇列中。該方法從不阻塞,並且都會成功(潛在的初階錯誤,像是分配" -"記憶體失敗除外)。可選的 args *block* 和 *timeout* 將被忽略,並且僅用於與 :" -"meth:`Queue.put` 相容。" +"將 *item* 放入佇列中。此 method 從不阻塞,並且都會成功(潛在的低階錯誤,像是" +"分配記憶體失敗除外)。可選的 args *block* 和 *timeout* 將被忽略,並且僅用於" +"與 :meth:`Queue.put` 相容。" #: ../../library/queue.rst:252 msgid "" -"Equivalent to ``put(item, block=False)``, provided for compatibility with " -":meth:`Queue.put_nowait`." -msgstr "等效於 ``put(item, block=False)``,用於與 :meth:`Queue.put_nowait` 相容。" +"Equivalent to ``put(item, block=False)``, provided for compatibility with :" +"meth:`Queue.put_nowait`." +msgstr "" +"等效於 ``put(item, block=False)``,用於與 :meth:`Queue.put_nowait` 相容。" #: ../../library/queue.rst:258 msgid "" @@ -360,11 +361,11 @@ msgid "" "immediately available, else raise the :exc:`Empty` exception (*timeout* is " "ignored in that case)." msgstr "" -"從佇列中刪除並傳回項目。如果可選的 args *block* 為 true,並且 *timeout* 為" -"\"None\"(預設值),則在必要時阻塞,直到項目可用。如果 *timeout* 是正數,則最" -"多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:`Empty` 例" -"外。否則(*block* 為 false),如果立即可用,則傳回一個項目,否則引發 :exc:" -"`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" +"從佇列中移除並回傳一個項目。如果可選的 args *block* 為 true,且 *timeout* 為 " +"``None``\\ (預設值),則在必要時阻塞,直到有可用的項目。如果 *timeout* 是正" +"數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:" +"`Empty` 例外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引" +"發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:275 msgid "Class :class:`multiprocessing.Queue`" @@ -374,7 +375,7 @@ msgstr "Class :class:`multiprocessing.Queue`" msgid "" "A queue class for use in a multi-processing (rather than multi-threading) " "context." -msgstr "用於多工(而非多執行緒)上下文的佇列 class。" +msgstr "用於多工處理(而非多執行緒)上下文的佇列 class。" #: ../../library/queue.rst:277 msgid "" From 7b1078792e9fcf5e0eeee2bbaf42685a9bbf62c5 Mon Sep 17 00:00:00 2001 From: allen91wu Date: Mon, 26 Sep 2022 15:57:22 +0800 Subject: [PATCH 3/7] update file from the review --- library/queue.po | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/library/queue.po b/library/queue.po index 661fb8dc59..43941a0c10 100644 --- a/library/queue.po +++ b/library/queue.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-04-15 00:13+0000\n" -"PO-Revision-Date: 2022-09-24 14:29+0800\n" +"PO-Revision-Date: 2022-09-26 23:05+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -99,9 +99,9 @@ msgid "" "until queue items are consumed. If *maxsize* is less than or equal to zero, " "the queue size is infinite." msgstr "" -"`LIFO (last-in, first-out)` 佇列的建構子。*maxsize* 是一個整數,用於設置佇列" -"中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,到佇列中的項目被消耗。" -"如果 *maxsize* 小於或等於零,則佇列大小為無限。" +":abbr:`LIFO (last-in, first-out)` 佇列的建構子。*maxsize* 是一個整數,用於設" +"置佇列中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,到佇列中的項目被" +"消耗。如果 *maxsize* 小於或等於零,則佇列大小為無限。" #: ../../library/queue.rst:54 msgid "" @@ -156,7 +156,7 @@ msgid "" "put_nowait`) is called on a :class:`Queue` object which is full." msgstr "" "當對一個已滿的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.put`\\ (或 :" -"meth:`~Queue.put_nowait`)將引發此例外。" +"meth:`~Queue.put_nowait`\\ )將引發此例外。" #: ../../library/queue.rst:99 msgid "Queue Objects" @@ -167,8 +167,8 @@ msgid "" "Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:" "`PriorityQueue`) provide the public methods described below." msgstr "" -"佇列物件(\\ :class:`Queue`\\ 、\\ :class:`LifoQueue`\\ 、\\ :class:" -"`PriorityQueue`\\ )提供下面描述的公用 method。" +"佇列物件(:class:`Queue`、:class:`LifoQueue`、:class:`PriorityQueue`)提供下" +"面描述的公用 method。" #: ../../library/queue.rst:107 msgid "" @@ -232,7 +232,7 @@ msgid "" "ignored in that case)." msgstr "" "從佇列中移除並回傳一個項目。如果可選的 args *block* 為 true,且 *timeout* 為 " -"``None``\\(預設值),則在必要時阻塞,直到有可用的項目。如果 *timeout* 是正" +"``None``\\ (預設值),則在必要時阻塞,直到有可用的項目。如果 *timeout* 是正" "數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:" "`Empty` 例外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引" "發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" @@ -247,7 +247,7 @@ msgid "" msgstr "" "在 POSIX 系統的 3.0 版之前,以及 Windows 的所有版本,如果 *block* 為 true 且 " "*timeout* 為 ``None``,則此操作將在底層鎖上進入不間斷等待。這意味著不會發生例" -"外,特別是 SIGINT(中斷訊號)不會觸發 :exc:`KeyboardInterrupt`\\ 。" +"外,特別是 SIGINT(中斷訊號)不會觸發 :exc:`KeyboardInterrupt`。" #: ../../library/queue.rst:161 ../../library/queue.rst:268 msgid "Equivalent to ``get(False)``." @@ -267,8 +267,8 @@ msgid "" "threads. For each :meth:`get` used to fetch a task, a subsequent call to :" "meth:`task_done` tells the queue that the processing on the task is complete." msgstr "" -"指示指示先前放入佇列的任務已完成。由佇列消費者執行緒使用。對於用來提取任務的" -"每個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。" +"表示先前放入佇列的任務已完成。由佇列消費者執行緒使用。對於用來提取任務的每" +"個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。" #: ../../library/queue.rst:173 msgid "" @@ -276,14 +276,14 @@ msgid "" "been processed (meaning that a :meth:`task_done` call was received for every " "item that had been :meth:`put` into the queue)." msgstr "" -"如果目前 :meth:`join` 阻塞,則當所有項目都已處理完畢後,它將恢復(這意味著對" -"於 :meth:`put` 已進入佇列的每個項目,都收到 :meth:`task_done` 的呼叫)。" +"如果目前 :meth:`join` 阻塞,它將會在所有項目都已處理完畢後恢復(代表對於以 :" +"meth:`put` 放進佇列的每個項目,都要收到 :meth:`task_done` 的呼叫)。" #: ../../library/queue.rst:177 msgid "" "Raises a :exc:`ValueError` if called more times than there were items placed " "in the queue." -msgstr "如果呼叫次數超過佇列中放置的項目數量,則引發 :exc:`ValueError`\\ 。" +msgstr "如果呼叫次數超過佇列中放置的項目數量,則引發 :exc:`ValueError`。" #: ../../library/queue.rst:183 msgid "Blocks until all items in the queue have been gotten and processed." @@ -340,9 +340,9 @@ msgid "" "The optional args *block* and *timeout* are ignored and only provided for " "compatibility with :meth:`Queue.put`." msgstr "" -"將 *item* 放入佇列中。此 method 從不阻塞,並且都會成功(潛在的低階錯誤,像是" -"分配記憶體失敗除外)。可選的 args *block* 和 *timeout* 將被忽略,並且僅用於" -"與 :meth:`Queue.put` 相容。" +"將 *item* 放入佇列中。此 method 從不阻塞,並且都會成功(除了潛在的低階錯誤," +"像是分配記憶體失敗)。可選的 args *block* 和 *timeout* 會被忽略,它們僅是為了" +"與 :meth:`Queue.put` 相容才存在。" #: ../../library/queue.rst:252 msgid "" @@ -375,7 +375,9 @@ msgstr "Class :class:`multiprocessing.Queue`" msgid "" "A queue class for use in a multi-processing (rather than multi-threading) " "context." -msgstr "用於多工處理(而非多執行緒)上下文的佇列 class。" +msgstr "" +"用於多行程處理 (multi-processing)(而非多執行緒)情境 (context) 的佇列 " +"class。" #: ../../library/queue.rst:277 msgid "" @@ -384,6 +386,6 @@ msgid "" "`~collections.deque.popleft` operations that do not require locking and also " "support indexing." msgstr "" -":class:`collections.deque` 是無界佇列的替代實作,具有快速原子 :meth:" -"`~collections.deque.append` 和 :meth:`~collections.deque.popleft` 操作,這些" -"操作不需要鎖定,並且還支持索引。" +":class:`collections.deque` 是無界佇列的替代實作,有快速且具原子性 (atomic) " +"的 :meth:`~collections.deque.append` 和 :meth:`~collections.deque.popleft` 操" +"作,這些操作不需要鎖定,並且還支持索引。" From f8af9b288f90a40d3b694ed1fc5faf98d2118aa0 Mon Sep 17 00:00:00 2001 From: allen91wu Date: Tue, 27 Sep 2022 00:13:14 +0800 Subject: [PATCH 4/7] fix typo --- library/queue.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/queue.po b/library/queue.po index 43941a0c10..4584768e56 100644 --- a/library/queue.po +++ b/library/queue.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-04-15 00:13+0000\n" -"PO-Revision-Date: 2022-09-26 23:05+0800\n" +"PO-Revision-Date: 2022-09-27 00:12+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -89,7 +89,7 @@ msgid "" msgstr "" ":abbr:`FIFO (first-in, first-out)` 佇列的建構子 (constructor)。*maxsize* 是一" "個整數,用於設置佇列中可放置的項目數的上限。一旦達到此大小,插入將會阻塞,直" -"到佇列中的項目被消耗完。如果 *maxsize* 小於或等於零,則佇列大小為無限。" +"到佇列中的項目被消耗。如果 *maxsize* 小於或等於零,則佇列大小為無限。" #: ../../library/queue.rst:45 msgid "" From 306bb1af07a6fb149f2b0b3a80eef5b1d0d7fff7 Mon Sep 17 00:00:00 2001 From: Allen Wu Date: Thu, 29 Sep 2022 11:06:11 +0800 Subject: [PATCH 5/7] Update library/queue.po Co-authored-by: Steven Hsu --- library/queue.po | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/library/queue.po b/library/queue.po index 4584768e56..62e21869e0 100644 --- a/library/queue.po +++ b/library/queue.po @@ -344,6 +344,19 @@ msgstr "" "像是分配記憶體失敗)。可選的 args *block* 和 *timeout* 會被忽略,它們僅是為了" "與 :meth:`Queue.put` 相容才存在。" +#: ../../library/queue.rst:243 +msgid "" +"This method has a C implementation which is reentrant. That is, a ``put()`` " +"or ``get()`` call can be interrupted by another ``put()`` call in the same " +"thread without deadlocking or corrupting internal state inside the queue. " +"This makes it appropriate for use in destructors such as ``__del__`` methods " +"or :mod:`weakref` callbacks." +msgstr "" +"此 method 有一個可重入 (reentrant) 的 C 實作。意思就是,一個 ``put()`` 或 " +"``get()`` 呼叫,可以被同一執行緒中的另一個 ``put()`` 呼叫中斷,而不會造成死" +"鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) 中使" +"用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" + #: ../../library/queue.rst:252 msgid "" "Equivalent to ``put(item, block=False)``, provided for compatibility with :" From b9abb515819f9325706ee9d1e75508fdfad61c6b Mon Sep 17 00:00:00 2001 From: Allen Wu Date: Thu, 29 Sep 2022 11:08:52 +0800 Subject: [PATCH 6/7] Update library/queue.po Co-authored-by: Steven Hsu --- library/queue.po | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/library/queue.po b/library/queue.po index 62e21869e0..dfbd0de458 100644 --- a/library/queue.po +++ b/library/queue.po @@ -357,6 +357,19 @@ msgstr "" "鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) 中使" "用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" +#: ../../library/queue.rst:243 +msgid "" +"This method has a C implementation which is reentrant. That is, a ``put()`` " +"or ``get()`` call can be interrupted by another ``put()`` call in the same " +"thread without deadlocking or corrupting internal state inside the queue. " +"This makes it appropriate for use in destructors such as ``__del__`` methods " +"or :mod:`weakref` callbacks." +msgstr "" +"此 method 有一個可重入 (reentrant) 的 C 實作。意思就是,一個 ``put()`` 或 " +"``get()`` 呼叫,可以被同一執行緒中的另一個 ``put()`` 呼叫中斷,而不會造成死" +"鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) 中使" +"用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" + #: ../../library/queue.rst:252 msgid "" "Equivalent to ``put(item, block=False)``, provided for compatibility with :" From dc21ddcc9f3553fc9abf3c743fcdeb21c932aa57 Mon Sep 17 00:00:00 2001 From: Allen Wu Date: Thu, 29 Sep 2022 13:12:42 +0800 Subject: [PATCH 7/7] remove redundant part --- library/queue.po | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/library/queue.po b/library/queue.po index dfbd0de458..62e21869e0 100644 --- a/library/queue.po +++ b/library/queue.po @@ -357,19 +357,6 @@ msgstr "" "鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) 中使" "用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" -#: ../../library/queue.rst:243 -msgid "" -"This method has a C implementation which is reentrant. That is, a ``put()`` " -"or ``get()`` call can be interrupted by another ``put()`` call in the same " -"thread without deadlocking or corrupting internal state inside the queue. " -"This makes it appropriate for use in destructors such as ``__del__`` methods " -"or :mod:`weakref` callbacks." -msgstr "" -"此 method 有一個可重入 (reentrant) 的 C 實作。意思就是,一個 ``put()`` 或 " -"``get()`` 呼叫,可以被同一執行緒中的另一個 ``put()`` 呼叫中斷,而不會造成死" -"鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) 中使" -"用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" - #: ../../library/queue.rst:252 msgid "" "Equivalent to ``put(item, block=False)``, provided for compatibility with :"