3
3
# This file is distributed under the same license as the Python package.
4
4
#
5
5
# Translators:
6
+ # Adrian Liaw <adrianliaw2000@gmail.com>, 2018
7
+ # Allen Wu <allen91.wu@gmail.com>, 2021
8
+ #
6
9
msgid ""
7
10
msgstr ""
8
11
"Project-Id-Version : Python 3.10\n "
9
12
"Report-Msgid-Bugs-To : \n "
10
13
"POT-Creation-Date : 2020-06-20 18:08+0800\n "
11
- "PO-Revision-Date : 2018-05-23 16:08+0000 \n "
12
- "Last-Translator : Adrian Liaw <adrianliaw2000 @gmail.com>\n "
14
+ "PO-Revision-Date : 2021-12-18 19:14+0800 \n "
15
+ "Last-Translator : Allen Wu <allen91.wu @gmail.com>\n "
13
16
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
17
"tw)\n "
15
18
"Language : zh_TW\n "
16
19
"MIME-Version : 1.0\n "
17
20
"Content-Type : text/plain; charset=UTF-8\n "
18
21
"Content-Transfer-Encoding : 8bit\n "
19
22
"Plural-Forms : nplurals=1; plural=0;\n "
23
+ "X-Generator : Poedit 3.0.1\n "
20
24
21
25
#: ../../library/queue.rst:2
22
26
msgid ":mod:`queue` --- A synchronized queue class"
23
- msgstr ""
27
+ msgstr ":mod:`queue` --- 同步佇列 (quene) class(類別) "
24
28
25
29
#: ../../library/queue.rst:7
26
30
msgid "**Source code:** :source:`Lib/queue.py`"
@@ -33,6 +37,9 @@ msgid ""
33
37
"exchanged safely between multiple threads. The :class:`Queue` class in this "
34
38
"module implements all the required locking semantics."
35
39
msgstr ""
40
+ ":mod:`queue` 模組實作多生產者、多消費者佇列。在執行緒程式設計中,必須在多執行"
41
+ "緒之間安全地交換資訊時,特別有用。此 module 中的 :class:`Queue` class 實作所"
42
+ "有必需的鎖定語義 (Semantics)。"
36
43
37
44
#: ../../library/queue.rst:16
38
45
msgid ""
@@ -44,24 +51,33 @@ msgid ""
44
51
"sorted (using the :mod:`heapq` module) and the lowest valued entry is "
45
52
"retrieved first."
46
53
msgstr ""
54
+ "此 module 實作三種型別的佇列,它們僅在取出條目的順序上有所不同。在 :abbr:"
55
+ "`FIFO (first-in, first-out)` 佇列中,先加入的任務是第一個被取出的。在 :abbr:"
56
+ "`LIFO (last-in, first-out)` 佇列中,最近被加入的條目是第一個被取出的(像堆疊 "
57
+ "(stack) 一樣操作)。使用優先佇列時,條目將保持排序狀態(使用 :mod:`heapq` "
58
+ "module),並先取出最低值條目。"
47
59
48
60
#: ../../library/queue.rst:24
49
61
msgid ""
50
62
"Internally, those three types of queues use locks to temporarily block "
51
63
"competing threads; however, they are not designed to handle reentrancy "
52
64
"within a thread."
53
65
msgstr ""
66
+ "在內部,這三種型別的佇列使用鎖來臨時鎖定競爭執行緒;但是,它們並不是被設計來"
67
+ "處理執行緒內的 reentrancy(可重入)。"
54
68
55
69
#: ../../library/queue.rst:28
56
70
msgid ""
57
71
"In addition, the module implements a \" simple\" :abbr:`FIFO (first-in, first-"
58
72
"out)` queue type, :class:`SimpleQueue`, whose specific implementation "
59
73
"provides additional guarantees in exchange for the smaller functionality."
60
74
msgstr ""
75
+ "此外,此 module 實作一個「簡單」的 :abbr:`FIFO (first-in, first-out)` 佇列型"
76
+ "別 :class:`SimpleQueue`,其明確的實作提供了額外的保證,以換取較小的功能。"
61
77
62
78
#: ../../library/queue.rst:33
63
79
msgid "The :mod:`queue` module defines the following classes and exceptions:"
64
- msgstr ""
80
+ msgstr ":mod:`queue` module 定義了以下的 class 和例外: "
65
81
66
82
#: ../../library/queue.rst:37
67
83
msgid ""
@@ -71,6 +87,9 @@ msgid ""
71
87
"until queue items are consumed. If *maxsize* is less than or equal to zero, "
72
88
"the queue size is infinite."
73
89
msgstr ""
90
+ ":abbr:`FIFO (first-in, first-out)` 佇列的建構子 (constructor)。*maxsize* 是一"
91
+ "個整數,用於設置佇列中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,直"
92
+ "到佇列中的項目被消耗完。如果 *maxsize* 小於或等於零,則佇列大小為無限。"
74
93
75
94
#: ../../library/queue.rst:45
76
95
msgid ""
@@ -80,6 +99,9 @@ msgid ""
80
99
"until queue items are consumed. If *maxsize* is less than or equal to zero, "
81
100
"the queue size is infinite."
82
101
msgstr ""
102
+ "`LIFO (last-in, first-out)` 佇列的建構子。*maxsize* 是一個整數,用於設置佇列"
103
+ "中可放置的項目數的上限。一旦達到此大小,插入將被鎖定,直到佇列中的項目被消耗"
104
+ "完。如果 *maxsize* 小於或等於零,則佇列大小為無限。"
83
105
84
106
#: ../../library/queue.rst:54
85
107
msgid ""
@@ -89,54 +111,73 @@ msgid ""
89
111
"consumed. If *maxsize* is less than or equal to zero, the queue size is "
90
112
"infinite."
91
113
msgstr ""
114
+ "優先佇列的建構子。*maxsize* 是一個整數,用於設置佇列中可放置的項目數的上限。"
115
+ "一旦達到此大小,插入將被鎖定,直到佇列中的項目被消耗完。如果 *maxsize* 小於或"
116
+ "等於零,則佇列大小為無限。"
92
117
93
118
#: ../../library/queue.rst:59
94
119
msgid ""
95
120
"The lowest valued entries are retrieved first (the lowest valued entry is "
96
121
"the one returned by ``sorted(list(entries))[0]``). A typical pattern for "
97
122
"entries is a tuple in the form: ``(priority_number, data)``."
98
123
msgstr ""
124
+ "首先取出最低值的條目(最低值的條目是 ``sorted(list(entries))[0]`` 回傳的)。"
125
+ "條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple。"
99
126
100
127
#: ../../library/queue.rst:63
101
128
msgid ""
102
129
"If the *data* elements are not comparable, the data can be wrapped in a "
103
130
"class that ignores the data item and only compares the priority number::"
104
131
msgstr ""
132
+ "如果 *data* 元素為不可比較的,則可以將資料包裝在一個 class 中,該類忽略資料項"
133
+ "目並僅比較優先數:\n"
134
+ "\n"
135
+ "::"
105
136
106
137
#: ../../library/queue.rst:76
107
138
msgid ""
108
139
"Constructor for an unbounded :abbr:`FIFO (first-in, first-out)` queue. "
109
140
"Simple queues lack advanced functionality such as task tracking."
110
141
msgstr ""
142
+ "無界的 :abbr:`FIFO (first-in, first-out)` 佇列的建構子。簡單佇列缺少任務追蹤"
143
+ "等進階功能。"
111
144
112
145
#: ../../library/queue.rst:84
113
146
msgid ""
114
147
"Exception raised when non-blocking :meth:`~Queue.get` (or :meth:`~Queue."
115
148
"get_nowait`) is called on a :class:`Queue` object which is empty."
116
149
msgstr ""
150
+ "當對一個空的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.get`\\ (或 :meth:"
151
+ "`~Queue.get_nowait`\\ )將引發例外。"
117
152
118
153
#: ../../library/queue.rst:91
119
154
msgid ""
120
155
"Exception raised when non-blocking :meth:`~Queue.put` (or :meth:`~Queue."
121
156
"put_nowait`) is called on a :class:`Queue` object which is full."
122
157
msgstr ""
158
+ "當對一個已滿的 :class:`Queue` 物件呼叫非阻塞的 :meth:`~Queue.put`\\ (或 :"
159
+ "meth:`~Queue.put_nowait`)將引發例外。"
123
160
124
161
#: ../../library/queue.rst:99
125
162
msgid "Queue Objects"
126
- msgstr ""
163
+ msgstr "佇列物件 "
127
164
128
165
#: ../../library/queue.rst:101
129
166
msgid ""
130
167
"Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:"
131
168
"`PriorityQueue`) provide the public methods described below."
132
169
msgstr ""
170
+ "佇列物件(\\ :class:`Queue`\\ 、\\ :class:`LifoQueue`\\ 、\\ :class:"
171
+ "`PriorityQueue`\\ )提供下面描述的公開方法。"
133
172
134
173
#: ../../library/queue.rst:107
135
174
msgid ""
136
175
"Return the approximate size of the queue. Note, qsize() > 0 doesn't "
137
176
"guarantee that a subsequent get() will not block, nor will qsize() < maxsize "
138
177
"guarantee that put() will not block."
139
178
msgstr ""
179
+ "回傳佇列的近似大小。注意,qsize() > 0 並不能保證後續的 get() 不會阻塞,"
180
+ "qsize() < maxsize 也不會保證 put() 不會阻塞。"
140
181
141
182
#: ../../library/queue.rst:114
142
183
msgid ""
@@ -145,6 +186,9 @@ msgid ""
145
186
"not block. Similarly, if empty() returns ``False`` it doesn't guarantee "
146
187
"that a subsequent call to get() will not block."
147
188
msgstr ""
189
+ "如果佇列為空,則回傳``True``,否則返回 ``False``。如果 empty() 回傳 "
190
+ "``True``,則不保證後續呼叫 put() 不會阻塞。同樣,如果 empty() 回傳 "
191
+ "``False``,則不保證後續呼叫 get() 不會阻塞。"
148
192
149
193
#: ../../library/queue.rst:122
150
194
msgid ""
@@ -153,6 +197,9 @@ msgid ""
153
197
"not block. Similarly, if full() returns ``False`` it doesn't guarantee that "
154
198
"a subsequent call to put() will not block."
155
199
msgstr ""
200
+ "如果佇列已滿,則回傳``True`` ,否則返回 ``False``。如果 full() 回傳 "
201
+ "``True``,則不保證後續呼叫 get() 不會阻塞。同樣,如果 full() 傳回 ``False``,"
202
+ "則不保證後續呼叫 put() 不會阻塞。"
156
203
157
204
#: ../../library/queue.rst:130
158
205
msgid ""
@@ -164,10 +211,15 @@ msgid ""
164
211
"is immediately available, else raise the :exc:`Full` exception (*timeout* is "
165
212
"ignored in that case)."
166
213
msgstr ""
214
+ "將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 ``None``"
215
+ "\\ (預設值),則在必要時阻塞,直到自由槽可用。如果 *timeout* 為正數,則最多"
216
+ "阻塞 *timeout* 秒,如果該時間內沒有可用槽,則會引發 :exc:`Full` 例外。否則"
217
+ "(*block* 為 false),如果自由槽立即可用,則將項目放在佇列中,否則引發 :exc:"
218
+ "`Full` 例外(*在這種情況下,*timeout* 將被忽略)。"
167
219
168
220
#: ../../library/queue.rst:141
169
221
msgid "Equivalent to ``put(item, False)``."
170
- msgstr ""
222
+ msgstr "等效於 ``put(item, False)``。 "
171
223
172
224
#: ../../library/queue.rst:146
173
225
msgid ""
@@ -179,6 +231,11 @@ msgid ""
179
231
"immediately available, else raise the :exc:`Empty` exception (*timeout* is "
180
232
"ignored in that case)."
181
233
msgstr ""
234
+ "從佇列中刪除並返回專案。如果可選的 args *block* 為 true,並且 *timeout* 為"
235
+ "\" None\" (預設值),則在必要時阻塞,直到項目可用。如果 *timeout* 是正數,則最"
236
+ "多會阻止 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:`Empty` 例"
237
+ "外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引發 :exc:"
238
+ "`Empty` 例外(在這種情況下,*timeout* 將被忽略)。"
182
239
183
240
#: ../../library/queue.rst:153
184
241
msgid ""
@@ -188,40 +245,49 @@ msgid ""
188
245
"can occur, and in particular a SIGINT will not trigger a :exc:"
189
246
"`KeyboardInterrupt`."
190
247
msgstr ""
248
+ "在 POSIX 系統上的 3.0 之前,對於 Windows 上的所有版本,如果 *block* 為 true "
249
+ "且 *timeout* 為\" None\" ,則此操作將在底層鎖上進入不間斷等待。這意味著不會發生"
250
+ "例外,特別是 SIGINT(中斷訊號)不會觸發 :exc:`KeyboardInterrupt`\\ 。"
191
251
192
252
#: ../../library/queue.rst:161 ../../library/queue.rst:268
193
253
msgid "Equivalent to ``get(False)``."
194
- msgstr ""
254
+ msgstr "等效於 ``get(False)``。 "
195
255
196
256
#: ../../library/queue.rst:163
197
257
msgid ""
198
258
"Two methods are offered to support tracking whether enqueued tasks have been "
199
259
"fully processed by daemon consumer threads."
200
260
msgstr ""
261
+ "提供了兩種方法來支援追蹤放入佇列的任務是否已由常駐使用者執行緒 (daemon "
262
+ "consumer threads) 完全處理。"
201
263
202
264
#: ../../library/queue.rst:169
203
265
msgid ""
204
266
"Indicate that a formerly enqueued task is complete. Used by queue consumer "
205
267
"threads. For each :meth:`get` used to fetch a task, a subsequent call to :"
206
268
"meth:`task_done` tells the queue that the processing on the task is complete."
207
269
msgstr ""
270
+ "指示以前放入佇列的任務已完成。由佇列使用者執行緒使用。對於用於獲取任務的每"
271
+ "個 :meth:`get`,隨後呼叫 :meth:`task_done` 告訴佇列任務的處理已完成。"
208
272
209
273
#: ../../library/queue.rst:173
210
274
msgid ""
211
275
"If a :meth:`join` is currently blocking, it will resume when all items have "
212
276
"been processed (meaning that a :meth:`task_done` call was received for every "
213
277
"item that had been :meth:`put` into the queue)."
214
278
msgstr ""
279
+ "如果目前 :meth:`join` 阻塞,則當所有項目都已處理完畢後,它將恢復(這意味著對"
280
+ "於 :meth:`put` 已進入佇列的每個項目,都收到 :meth:`task_done` 的呼叫)。"
215
281
216
282
#: ../../library/queue.rst:177
217
283
msgid ""
218
284
"Raises a :exc:`ValueError` if called more times than there were items placed "
219
285
"in the queue."
220
- msgstr ""
286
+ msgstr "如果呼叫次數超過佇列中放置的項目,則引發 :exc:`ValueError` \\ 。 "
221
287
222
288
#: ../../library/queue.rst:183
223
289
msgid "Blocks until all items in the queue have been gotten and processed."
224
- msgstr ""
290
+ msgstr "阻塞直到佇列中的所有項目都已獲取並處理完畢。 "
225
291
226
292
#: ../../library/queue.rst:185
227
293
msgid ""
@@ -231,32 +297,41 @@ msgid ""
231
297
"complete. When the count of unfinished tasks drops to zero, :meth:`join` "
232
298
"unblocks."
233
299
msgstr ""
300
+ "每當項目被加到佇列中時,未完成任務的計數都會增加。每當使用者執行緒呼叫 :meth:"
301
+ "`task_done` 以指示該項目已被取出並且對其的所有工作都已完成時,計數就會下降。"
302
+ "當未完成任務的計數降至零時,:meth:`join` 將停止阻塞。"
234
303
235
304
#: ../../library/queue.rst:191
236
305
msgid "Example of how to wait for enqueued tasks to be completed::"
237
306
msgstr ""
307
+ "如何等待放入佇列的任務完成的範例:\n"
308
+ "\n"
309
+ "::"
238
310
239
311
#: ../../library/queue.rst:218
240
312
msgid "SimpleQueue Objects"
241
- msgstr "SimpleQueue 物件 "
313
+ msgstr "簡單佇列物件 "
242
314
243
315
#: ../../library/queue.rst:220
244
316
msgid ""
245
317
":class:`SimpleQueue` objects provide the public methods described below."
246
- msgstr ""
318
+ msgstr ":class:`SimpleQueue` 物件提供下面描述的公開方法。 "
247
319
248
320
#: ../../library/queue.rst:224
249
321
msgid ""
250
322
"Return the approximate size of the queue. Note, qsize() > 0 doesn't "
251
323
"guarantee that a subsequent get() will not block."
252
324
msgstr ""
325
+ "傳回佇列的近似大小。注意,qsize() > 0 並不能保證後續的 get() 不會阻塞。"
253
326
254
327
#: ../../library/queue.rst:230
255
328
msgid ""
256
329
"Return ``True`` if the queue is empty, ``False`` otherwise. If empty() "
257
330
"returns ``False`` it doesn't guarantee that a subsequent call to get() will "
258
331
"not block."
259
332
msgstr ""
333
+ "如果佇列為空,則回傳 ``True``,否則回傳 ``False``。如果 empty() 回傳 "
334
+ "``False``,則不保證後續呼叫 get() 不會阻塞。"
260
335
261
336
#: ../../library/queue.rst:237
262
337
msgid ""
@@ -265,12 +340,15 @@ msgid ""
265
340
"The optional args *block* and *timeout* are ignored and only provided for "
266
341
"compatibility with :meth:`Queue.put`."
267
342
msgstr ""
343
+ "將 *item* 放入佇列中。該方法從不阻塞,並且都會成功(潛在的初階錯誤,像是分配"
344
+ "記憶體失敗除外)。可選的 args *block* 和 *timeout* 將被忽略,並且僅用於與 :"
345
+ "meth:`Queue.put` 相容。"
268
346
269
347
#: ../../library/queue.rst:252
270
348
msgid ""
271
349
"Equivalent to ``put(item)``, provided for compatibility with :meth:`Queue."
272
350
"put_nowait`."
273
- msgstr ""
351
+ msgstr "等效於 ``put(item)``,用於與 :meth:`Queue.put_nowait` 相容。 "
274
352
275
353
#: ../../library/queue.rst:258
276
354
msgid ""
@@ -282,16 +360,21 @@ msgid ""
282
360
"immediately available, else raise the :exc:`Empty` exception (*timeout* is "
283
361
"ignored in that case)."
284
362
msgstr ""
363
+ "從佇列中刪除並傳回項目。如果可選的 args *block* 為 true,並且 *timeout* 為"
364
+ "\" None\" (預設值),則在必要時阻塞,直到項目可用。如果 *timeout* 是正數,則最"
365
+ "多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:`Empty` 例"
366
+ "外。否則(*block* 為 false),如果立即可用,則傳回一個項目,否則引發 :exc:"
367
+ "`Empty` 例外(在這種情況下,*timeout* 將被忽略)。"
285
368
286
369
#: ../../library/queue.rst:275
287
370
msgid "Class :class:`multiprocessing.Queue`"
288
- msgstr ":class:`multiprocessing.Queue` 類型 "
371
+ msgstr "Class :class:`multiprocessing.Queue`"
289
372
290
373
#: ../../library/queue.rst:274
291
374
msgid ""
292
375
"A queue class for use in a multi-processing (rather than multi-threading) "
293
376
"context."
294
- msgstr ""
377
+ msgstr "用於多工(而非多執行緒)上下文的佇列 class。 "
295
378
296
379
#: ../../library/queue.rst:277
297
380
msgid ""
@@ -300,3 +383,6 @@ msgid ""
300
383
"`~collections.deque.popleft` operations that do not require locking and also "
301
384
"support indexing."
302
385
msgstr ""
386
+ ":class:`collections.deque` 是無界佇列的替代實作,具有快速原子 :meth:"
387
+ "`~collections.deque.append` 和 :meth:`~collections.deque.popleft` 操作,這些"
388
+ "操作不需要鎖定,並且還支持索引。"
0 commit comments