@@ -11,7 +11,7 @@ msgstr ""
11
11
"Project-Id-Version :Python 3.10\n "
12
12
"Report-Msgid-Bugs-To :\n "
13
13
"POT-Creation-Date :2022-04-15 00:13+0000\n "
14
- "PO-Revision-Date :2021-12-18 19:14 +0800\n "
14
+ "PO-Revision-Date :2022-09-24 14:29 +0800\n "
15
15
"Last-Translator :Allen Wu <allen91.wu@gmail.com>\n "
16
16
"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
17
17
"tw)\n "
@@ -24,7 +24,7 @@ msgstr ""
24
24
25
25
#: ../../library/queue.rst:2
26
26
msgid ":mod:`queue` --- A synchronized queue class"
27
- msgstr ":mod:`queue` --- 同步佇列 (quene ) class(類別)"
27
+ msgstr ":mod:`queue` --- 同步佇列 (queue ) class(類別)"
28
28
29
29
#: ../../library/queue.rst:7
30
30
msgid "**Source code:** :source:`Lib/queue.py`"
@@ -37,9 +37,9 @@ msgid ""
37
37
"exchanged safely between multiple threads. The :class:`Queue` class in this "
38
38
"module implements all the required locking semantics."
39
39
msgstr ""
40
- ":mod:`queue`模組實作多生產者 、多消費者佇列。在執行緒程式設計中,必須在多執行 "
41
- "緒之間安全地交換資訊時 ,特別有用。此 module 中的 :class:`Queue`class 實作所 "
42
- "有必需的鎖定語義 (Semantics )。"
40
+ ":mod:`queue`module(模組)實作多生產者 、多消費者佇列。在執行緒程式設計中,必 "
41
+ "須在多執行緒之間安全地交換資訊時 ,特別有用。此 module 中的 :class:`Queue` "
42
+ "class 實作所有必需的鎖定語義 (locking semantics )。"
43
43
44
44
#: ../../library/queue.rst:16
45
45
msgid ""
@@ -54,17 +54,17 @@ msgstr ""
54
54
"此 module 實作三種型別的佇列,它們僅在取出條目的順序上有所不同。在 :abbr:"
55
55
"`FIFO (first-in, first-out)` 佇列中,先加入的任務是第一個被取出的。在 :abbr:"
56
56
"`LIFO (last-in, first-out)` 佇列中,最近被加入的條目是第一個被取出的(像堆疊 "
57
- "(stack) 一樣操作)。使用優先佇列時 ,條目將保持排序狀態(使用 :mod:`heapq` "
58
- "module),並先取出最低值條目。"
57
+ "(stack) 一樣操作)。使用優先佇列 (priority queue) 時 ,條目將保持排序狀態(使 "
58
+ "用 :mod:`heapq` module),並先取出最低值條目。"
59
59
60
60
#: ../../library/queue.rst:24
61
61
msgid ""
62
62
"Internally, those three types of queues use locks to temporarily block "
63
63
"competing threads; however, they are not designed to handle reentrancy "
64
64
"within a thread."
65
65
msgstr ""
66
- "在內部,這三種型別的佇列使用鎖來臨時鎖定競爭執行緒 ;但是,它們並不是被設計來 "
67
- "處理執行緒內的 reentrancy(可重入)。"
66
+ "在內部,這三種型別的佇列使用鎖 (lock) 來暫時阻塞競爭執行緒 ;但是,它們並不是 "
67
+ "被設計來處理執行緒內的 reentrancy(可重入)。"
68
68
69
69
#: ../../library/queue.rst:28
70
70
msgid ""
@@ -73,7 +73,7 @@ msgid ""
73
73
"provides additional guarantees in exchange for the smaller functionality."
74
74
msgstr ""
75
75
"此外,此 module 實作一個「簡單」的 :abbr:`FIFO (first-in, first-out)` 佇列型"
76
- "別 :class:`SimpleQueue`,其明確的實作提供了額外的保證,以換取較小的功能 。"
76
+ "別 :class:`SimpleQueue`,其特定的實作是以較少的功能為代價,來提供額外的保證 。"
77
77
78
78
#: ../../library/queue.rst:33
79
79
msgid "The :mod:`queue` module defines the following classes and exceptions:"
@@ -88,7 +88,7 @@ msgid ""
88
88
"the queue size is infinite."
89
89
msgstr ""
90
90
":abbr:`FIFO (first-in, first-out)` 佇列的建構子 (constructor)。*maxsize* 是一"
91
- "個整數,用於設置佇列中可放置的項目數的上限。一旦達到此大小,插入將被鎖定 ,直"
91
+ "個整數,用於設置佇列中可放置的項目數的上限。一旦達到此大小,插入將會阻塞 ,直"
92
92
"到佇列中的項目被消耗完。如果 *maxsize* 小於或等於零,則佇列大小為無限。"
93
93
94
94
#: ../../library/queue.rst:45
@@ -100,8 +100,8 @@ msgid ""
100
100
"the queue size is infinite."
101
101
msgstr ""
102
102
"`LIFO (last-in, first-out)` 佇列的建構子。*maxsize* 是一個整數,用於設置佇列"
103
- "中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,直到佇列中的項目被消耗 "
104
- "完。 如果 *maxsize* 小於或等於零,則佇列大小為無限。"
103
+ "中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,到佇列中的項目被消耗。 "
104
+ "如果 *maxsize* 小於或等於零,則佇列大小為無限。"
105
105
106
106
#: ../../library/queue.rst:54
107
107
msgid ""
@@ -112,25 +112,25 @@ msgid ""
112
112
"infinite."
113
113
msgstr ""
114
114
"優先佇列的建構子。*maxsize* 是一個整數,用於設置佇列中可放置的項目數的上限。"
115
- "一旦達到此大小,插入將被鎖定,直到佇列中的項目被消耗完 。如果 *maxsize*小於或 "
116
- "等於零 ,則佇列大小為無限。"
115
+ "一旦達到此大小,插入將被阻塞,直到佇列中的項目被消耗 。如果 *maxsize*小於或等 "
116
+ "於零 ,則佇列大小為無限。"
117
117
118
118
#: ../../library/queue.rst:59
119
119
msgid ""
120
120
"The lowest valued entries are retrieved first (the lowest valued entry is "
121
121
"the one returned by ``sorted(list(entries))[0]``). A typical pattern for "
122
122
"entries is a tuple in the form: ``(priority_number, data)``."
123
123
msgstr ""
124
- "首先取出最低值的條目(最低值的條目是 ``sorted(list(entries))[0]``回傳的)。 "
125
- "條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple。"
124
+ "最低值的條目會最先被取出(最低值的條目是被 ``sorted(list(entries))[0]``回傳 "
125
+ "的)。 條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple(元組) 。"
126
126
127
127
#: ../../library/queue.rst:63
128
128
msgid ""
129
129
"If the *data* elements are not comparable, the data can be wrapped in a "
130
130
"class that ignores the data item and only compares the priority number::"
131
131
msgstr ""
132
- "如果 *data* 元素為不可比較的,則可以將資料包裝在一個 class 中,該類忽略資料項 "
133
- "目並僅比較優先數 :\n"
132
+ "如果 *data* 元素為不可比較的,則可以將資料包裝在一個 class 中,該 class 忽略 "
133
+ "資料項目並僅比較優先數 :\n"
134
134
"\n"
135
135
"::"
136
136
@@ -147,16 +147,16 @@ msgid ""
147
147
"Exception raised when non-blocking :meth:`~Queue.get` (or :meth:`~Queue."
148
148
"get_nowait`) is called on a :class:`Queue` object which is empty."
149
149
msgstr ""
150
- "當對一個空的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.get` \\ (或 :meth: "
151
- "` ~Queue.get_nowait`\\ )將引發例外 。"
150
+ "當對一個空的 :class:`Queue` 物件呼叫非阻塞的(non-blocking) :meth:`~Queue."
151
+ "get` \\ (或 :meth:` ~Queue.get_nowait`\\ )將引發此例外 。"
152
152
153
153
#: ../../library/queue.rst:91
154
154
msgid ""
155
155
"Exception raised when non-blocking :meth:`~Queue.put` (or :meth:`~Queue."
156
156
"put_nowait`) is called on a :class:`Queue` object which is full."
157
157
msgstr ""
158
158
"當對一個已滿的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.put`\\ (或 :"
159
- "meth:`~Queue.put_nowait`)將引發例外 。"
159
+ "meth:`~Queue.put_nowait`)將引發此例外 。"
160
160
161
161
#: ../../library/queue.rst:99
162
162
msgid "Queue Objects"
@@ -168,7 +168,7 @@ msgid ""
168
168
"`PriorityQueue`) provide the public methods described below."
169
169
msgstr ""
170
170
"佇列物件(\\ :class:`Queue`\\ 、\\ :class:`LifoQueue`\\ 、\\ :class:"
171
- "`PriorityQueue`\\ )提供下面描述的公開方法 。"
171
+ "`PriorityQueue`\\ )提供下面描述的公用 method 。"
172
172
173
173
#: ../../library/queue.rst:107
174
174
msgid ""
@@ -186,7 +186,7 @@ msgid ""
186
186
"not block. Similarly, if empty() returns ``False`` it doesn't guarantee "
187
187
"that a subsequent call to get() will not block."
188
188
msgstr ""
189
- "如果佇列為空,則回傳``True``,否則返回 ``False``。如果 empty() 回傳 "
189
+ "如果佇列為空,則回傳 ``True``,否則回傳 ``False``。如果 empty() 回傳 "
190
190
"``True``,則不保證後續呼叫 put() 不會阻塞。同樣,如果 empty() 回傳 "
191
191
"``False``,則不保證後續呼叫 get() 不會阻塞。"
192
192
@@ -197,8 +197,8 @@ msgid ""
197
197
"not block. Similarly, if full() returns ``False`` it doesn't guarantee that "
198
198
"a subsequent call to put() will not block."
199
199
msgstr ""
200
- "如果佇列已滿,則回傳``True`` ,否則返回 ``False``。如果 full() 回傳 "
201
- "``True``,則不保證後續呼叫 get() 不會阻塞。同樣,如果 full()傳回 ``False``,"
200
+ "如果佇列已滿,則回傳 ``True`` ,否則回傳 ``False``。如果 full() 回傳 "
201
+ "``True``,則不保證後續呼叫 get() 不會阻塞。同樣,如果 full()回傳 ``False``,"
202
202
"則不保證後續呼叫 put() 不會阻塞。"
203
203
204
204
#: ../../library/queue.rst:130
@@ -212,10 +212,10 @@ msgid ""
212
212
"ignored in that case)."
213
213
msgstr ""
214
214
"將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 ``None``"
215
- "\\ (預設值),則在必要時阻塞,直到自由槽可用 。如果 *timeout*為正數,則最多 "
216
- "阻塞 *timeout* 秒,如果該時間內沒有可用槽 ,則會引發 :exc:`Full` 例外。否則 "
217
- "(*block* 為 false),如果自由槽立即可用,則將項目放在佇列中,否則引發 :exc: "
218
- "`Full` 例外(* 在這種情況下,*timeout* 將被忽略)。"
215
+ "\\ (預設值),則在必要時阻塞,直到自由槽 (free slot) 可用 。如果 *timeout*為 "
216
+ "正數,則最多阻塞 *timeout* 秒,如果該時間內沒有可用的自由槽 ,則會引發 :exc:"
217
+ "`Full` 例外。否則 (*block* 為 false),如果自由槽立即可用,則將項目放在佇列 "
218
+ "中,否則引發 :exc: `Full` 例外(在這種情況下,*timeout* 將被忽略)。"
219
219
220
220
#: ../../library/queue.rst:141
221
221
msgid "Equivalent to ``put(item, block=False)``."
@@ -231,11 +231,11 @@ msgid ""
231
231
"immediately available, else raise the :exc:`Empty` exception (*timeout* is "
232
232
"ignored in that case)."
233
233
msgstr ""
234
- "從佇列中刪除並返回專案 。如果可選的 args *block* 為 true,並且 *timeout* 為"
235
- "\" None\" (預設值),則在必要時阻塞,直到項目可用 。如果 *timeout*是正數,則最 "
236
- "多會阻止 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:`Empty` 例 "
237
- "外 。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引發 :exc: "
238
- "`Empty` 例外(在這種情況下,*timeout* 將被忽略)。"
234
+ "從佇列中移除並回傳一個項目 。如果可選的 args *block* 為 true,且 *timeout* 為 "
235
+ "`` None`` \\ (預設值),則在必要時阻塞,直到有可用的項目 。如果 *timeout*是正 "
236
+ "數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:"
237
+ "`Empty` 例外 。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引 "
238
+ "發 :exc: `Empty` 例外(在這種情況下,*timeout* 將被忽略)。"
239
239
240
240
#: ../../library/queue.rst:153
241
241
msgid ""
@@ -245,9 +245,9 @@ msgid ""
245
245
"can occur, and in particular a SIGINT will not trigger a :exc:"
246
246
"`KeyboardInterrupt`."
247
247
msgstr ""
248
- "在 POSIX系統上的 3.0之前,對於 Windows上的所有版本 ,如果 *block* 為 true "
249
- "且 *timeout* 為\" None\" ,則此操作將在底層鎖上進入不間斷等待。這意味著不會發生 "
250
- "例外 ,特別是 SIGINT(中斷訊號)不會觸發 :exc:`KeyboardInterrupt`\\ 。"
248
+ "在 POSIX系統的 3.0版之前,以及 Windows的所有版本 ,如果 *block* 為 true 且 "
249
+ "*timeout* 為 `` None`` ,則此操作將在底層鎖上進入不間斷等待。這意味著不會發生例 "
250
+ "外 ,特別是 SIGINT(中斷訊號)不會觸發 :exc:`KeyboardInterrupt`\\ 。"
251
251
252
252
#: ../../library/queue.rst:161 ../../library/queue.rst:268
253
253
msgid "Equivalent to ``get(False)``."
@@ -258,7 +258,7 @@ msgid ""
258
258
"Two methods are offered to support tracking whether enqueued tasks have been "
259
259
"fully processed by daemon consumer threads."
260
260
msgstr ""
261
- "提供了兩種方法來支援追蹤放入佇列的任務是否已由常駐使用者執行緒 (daemon "
261
+ "有兩個 method 可以支援追蹤放入佇列的任務是否已由常駐消費者執行緒 (daemon "
262
262
"consumer threads) 完全處理。"
263
263
264
264
#: ../../library/queue.rst:169
@@ -267,8 +267,8 @@ msgid ""
267
267
"threads. For each :meth:`get` used to fetch a task, a subsequent call to :"
268
268
"meth:`task_done` tells the queue that the processing on the task is complete."
269
269
msgstr ""
270
- "指示以前放入佇列的任務已完成。由佇列使用者執行緒使用。對於用於獲取任務的每 "
271
- "個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。"
270
+ "指示指示先前放入佇列的任務已完成。由佇列消費者執行緒使用。對於用來提取任務的 "
271
+ "每個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。"
272
272
273
273
#: ../../library/queue.rst:173
274
274
msgid ""
@@ -283,11 +283,11 @@ msgstr ""
283
283
msgid ""
284
284
"Raises a :exc:`ValueError` if called more times than there were items placed "
285
285
"in the queue."
286
- msgstr "如果呼叫次數超過佇列中放置的項目 ,則引發 :exc:`ValueError`\\ 。"
286
+ msgstr "如果呼叫次數超過佇列中放置的項目數量 ,則引發 :exc:`ValueError`\\ 。"
287
287
288
288
#: ../../library/queue.rst:183
289
289
msgid "Blocks until all items in the queue have been gotten and processed."
290
- msgstr "阻塞直到佇列中的所有項目都已獲取並處理完畢 。"
290
+ msgstr "持續阻塞直到佇列中的所有項目都已被獲取並處理完畢 。"
291
291
292
292
#: ../../library/queue.rst:185
293
293
msgid ""
@@ -297,7 +297,7 @@ msgid ""
297
297
"complete. When the count of unfinished tasks drops to zero, :meth:`join` "
298
298
"unblocks."
299
299
msgstr ""
300
- "每當項目被加到佇列中時,未完成任務的計數都會增加。每當使用者執行緒呼叫 :meth:"
300
+ "每當項目被加到佇列中時,未完成任務的計數都會增加。每當消費者執行緒呼叫 :meth:"
301
301
"`task_done` 以指示該項目已被取出並且對其的所有工作都已完成時,計數就會下降。"
302
302
"當未完成任務的計數降至零時,:meth:`join` 將停止阻塞。"
303
303
@@ -310,12 +310,12 @@ msgstr ""
310
310
311
311
#: ../../library/queue.rst:218
312
312
msgid "SimpleQueue Objects"
313
- msgstr "簡單佇列物件 "
313
+ msgstr "SimpleQueue 物件 "
314
314
315
315
#: ../../library/queue.rst:220
316
316
msgid ""
317
317
":class:`SimpleQueue` objects provide the public methods described below."
318
- msgstr ":class:`SimpleQueue`物件提供下面描述的公開方法 。"
318
+ msgstr ":class:`SimpleQueue`物件提供下面描述的公用 method 。"
319
319
320
320
#: ../../library/queue.rst:224
321
321
msgid ""
@@ -340,15 +340,16 @@ msgid ""
340
340
"The optional args *block* and *timeout* are ignored and only provided for "
341
341
"compatibility with :meth:`Queue.put`."
342
342
msgstr ""
343
- "將 *item* 放入佇列中。該方法從不阻塞 ,並且都會成功(潛在的初階錯誤,像是分配 "
344
- "記憶體失敗除外 )。可選的 args *block* 和 *timeout* 將被忽略,並且僅用於與 : "
345
- "meth:`Queue.put` 相容。"
343
+ "將 *item* 放入佇列中。此 method 從不阻塞 ,並且都會成功(潛在的低階錯誤,像是 "
344
+ "分配記憶體失敗除外 )。可選的 args *block* 和 *timeout* 將被忽略,並且僅用於 "
345
+ "與 : meth:`Queue.put` 相容。"
346
346
347
347
#: ../../library/queue.rst:252
348
348
msgid ""
349
- "Equivalent to ``put(item, block=False)``, provided for compatibility with "
350
- ":meth:`Queue.put_nowait`."
351
- msgstr "等效於 ``put(item, block=False)``,用於與 :meth:`Queue.put_nowait` 相容。"
349
+ "Equivalent to ``put(item, block=False)``, provided for compatibility with :"
350
+ "meth:`Queue.put_nowait`."
351
+ msgstr ""
352
+ "等效於 ``put(item, block=False)``,用於與 :meth:`Queue.put_nowait` 相容。"
352
353
353
354
#: ../../library/queue.rst:258
354
355
msgid ""
@@ -360,11 +361,11 @@ msgid ""
360
361
"immediately available, else raise the :exc:`Empty` exception (*timeout* is "
361
362
"ignored in that case)."
362
363
msgstr ""
363
- "從佇列中刪除並傳回項目 。如果可選的 args *block* 為 true,並且 *timeout* 為"
364
- "\" None\" (預設值),則在必要時阻塞,直到項目可用 。如果 *timeout*是正數,則最 "
365
- "多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:`Empty` 例 "
366
- "外 。否則(*block* 為 false),如果立即可用,則傳回一個項目,否則引發 :exc: "
367
- "`Empty` 例外(在這種情況下,*timeout* 將被忽略)。"
364
+ "從佇列中移除並回傳一個項目 。如果可選的 args *block* 為 true,且 *timeout* 為 "
365
+ "`` None`` \\ (預設值),則在必要時阻塞,直到有可用的項目 。如果 *timeout*是正 "
366
+ "數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:"
367
+ "`Empty` 例外 。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引 "
368
+ "發 :exc: `Empty` 例外(在這種情況下,*timeout* 將被忽略)。"
368
369
369
370
#: ../../library/queue.rst:275
370
371
msgid "Class :class:`multiprocessing.Queue`"
@@ -374,7 +375,7 @@ msgstr "Class :class:`multiprocessing.Queue`"
374
375
msgid ""
375
376
"A queue class for use in a multi-processing (rather than multi-threading) "
376
377
"context."
377
- msgstr "用於多工 (而非多執行緒)上下文的佇列 class。"
378
+ msgstr "用於多工處理 (而非多執行緒)上下文的佇列 class。"
378
379
379
380
#: ../../library/queue.rst:277
380
381
msgid ""