8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.13\n "
10
10
"Report-Msgid-Bugs-To : \n "
11
- "POT-Creation-Date : 2025-02-23 00:15 +0000\n "
11
+ "POT-Creation-Date : 2025-07-25 00:16 +0000\n "
12
12
"PO-Revision-Date : 2022-02-20 18:34+0800\n "
13
13
"Last-Translator : Matt Wang <mattwang44@gmail.com>\n "
14
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -162,31 +162,55 @@ msgid "Return the number of items in the queue."
162
162
msgstr "回傳佇列中的元素數量。"
163
163
164
164
#: ../../library/asyncio-queue.rst:105
165
- msgid ""
166
- "Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` raise :"
167
- "exc:`QueueShutDown`."
165
+ msgid "Put a :class:`Queue` instance into a shutdown mode."
168
166
msgstr ""
169
167
170
- #: ../../library/asyncio-queue.rst:108
168
+ #: ../../library/asyncio-queue.rst:107
171
169
msgid ""
172
- "By default, :meth:`~Queue.get` on a shut down queue will only raise once the "
173
- "queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise "
174
- "immediately instead ."
170
+ "The queue can no longer grow. Future calls to :meth:`~Queue.put` raise :exc: "
171
+ "`QueueShutDown`. Currently blocked callers of :meth:`~Queue.put` will be "
172
+ "unblocked and will raise :exc:`QueueShutDown` in the formerly blocked thread ."
175
173
msgstr ""
176
174
177
175
#: ../../library/asyncio-queue.rst:112
178
176
msgid ""
179
- "All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be "
180
- "unblocked. If *immediate* is true, a task will be marked as done for each "
181
- "remaining item in the queue, which may unblock callers of :meth:`~Queue."
182
- "join`."
177
+ "If *immediate* is false (the default), the queue can be wound down normally "
178
+ "with :meth:`~Queue.get` calls to extract tasks that have already been loaded."
179
+ msgstr ""
180
+
181
+ #: ../../library/asyncio-queue.rst:116
182
+ msgid ""
183
+ "And if :meth:`~Queue.task_done` is called for each remaining task, a "
184
+ "pending :meth:`~Queue.join` will be unblocked normally."
183
185
msgstr ""
184
186
185
- #: ../../library/asyncio-queue.rst:121
187
+ #: ../../library/asyncio-queue.rst:119
188
+ msgid ""
189
+ "Once the queue is empty, future calls to :meth:`~Queue.get` will raise :exc:"
190
+ "`QueueShutDown`."
191
+ msgstr ""
192
+
193
+ #: ../../library/asyncio-queue.rst:122
194
+ msgid ""
195
+ "If *immediate* is true, the queue is terminated immediately. The queue is "
196
+ "drained to be completely empty. All callers of :meth:`~Queue.join` are "
197
+ "unblocked regardless of the number of unfinished tasks. Blocked callers of :"
198
+ "meth:`~Queue.get` are unblocked and will raise :exc:`QueueShutDown` because "
199
+ "the queue is empty."
200
+ msgstr ""
201
+
202
+ #: ../../library/asyncio-queue.rst:129
203
+ msgid ""
204
+ "Use caution when using :meth:`~Queue.join` with *immediate* set to true. "
205
+ "This unblocks the join even when no work has been done on the tasks, "
206
+ "violating the usual invariant for joining a queue."
207
+ msgstr ""
208
+
209
+ #: ../../library/asyncio-queue.rst:137
186
210
msgid "Indicate that a formerly enqueued work item is complete."
187
211
msgstr "表示前面一個排隊的工作項目已經完成。"
188
212
189
- #: ../../library/asyncio-queue.rst:123
213
+ #: ../../library/asyncio-queue.rst:139
190
214
msgid ""
191
215
"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work "
192
216
"item, a subsequent call to :meth:`task_done` tells the queue that the "
@@ -195,7 +219,7 @@ msgstr ""
195
219
"由佇列消耗者使用。對於每個用於取得一個工作項目的 :meth:`~Queue.get`,接續的 :"
196
220
"meth:`task_done` 呼叫會告訴佇列這個工作項目的處理已經完成。"
197
221
198
- #: ../../library/asyncio-queue.rst:127
222
+ #: ../../library/asyncio-queue.rst:143
199
223
msgid ""
200
224
"If a :meth:`join` is currently blocking, it will resume when all items have "
201
225
"been processed (meaning that a :meth:`task_done` call was received for every "
@@ -204,76 +228,70 @@ msgstr ""
204
228
"如果 :meth:`join` 目前正在阻塞,在所有項目都被處理後會解除阻塞(意味著每個"
205
229
"以 :meth:`~Queue.put` 放進佇列的條目都會收到一個 :meth:`task_done`)。"
206
230
207
- #: ../../library/asyncio-queue.rst:132
208
- msgid ""
209
- "``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item "
210
- "in the queue."
211
- msgstr ""
212
-
213
- #: ../../library/asyncio-queue.rst:135
231
+ #: ../../library/asyncio-queue.rst:148
214
232
msgid ""
215
233
"Raises :exc:`ValueError` if called more times than there were items placed "
216
234
"in the queue."
217
235
msgstr "如果被呼叫的次數多於放入佇列中的項目數量,將引發 :exc:`ValueError`。"
218
236
219
- #: ../../library/asyncio-queue.rst:140
237
+ #: ../../library/asyncio-queue.rst:153
220
238
msgid "Priority Queue"
221
239
msgstr "Priority Queue(優先佇列)"
222
240
223
- #: ../../library/asyncio-queue.rst:144
241
+ #: ../../library/asyncio-queue.rst:157
224
242
msgid ""
225
243
"A variant of :class:`Queue`; retrieves entries in priority order (lowest "
226
244
"first)."
227
245
msgstr ":class:`Queue` 的變形;按優先順序取出條目 (最小的先取出)。"
228
246
229
- #: ../../library/asyncio-queue.rst:147
247
+ #: ../../library/asyncio-queue.rst:160
230
248
msgid "Entries are typically tuples of the form ``(priority_number, data)``."
231
249
msgstr "條目通常是 ``(priority_number, data)`` 形式的 tuple(元組)。"
232
250
233
- #: ../../library/asyncio-queue.rst:152
251
+ #: ../../library/asyncio-queue.rst:165
234
252
msgid "LIFO Queue"
235
253
msgstr "LIFO Queue"
236
254
237
- #: ../../library/asyncio-queue.rst:156
255
+ #: ../../library/asyncio-queue.rst:169
238
256
msgid ""
239
257
"A variant of :class:`Queue` that retrieves most recently added entries first "
240
258
"(last in, first out)."
241
259
msgstr ":class:`Queue` 的變形,先取出最近新增的條目(後進先出)。"
242
260
243
- #: ../../library/asyncio-queue.rst:161
261
+ #: ../../library/asyncio-queue.rst:174
244
262
msgid "Exceptions"
245
263
msgstr "例外"
246
264
247
- #: ../../library/asyncio-queue.rst:165
265
+ #: ../../library/asyncio-queue.rst:178
248
266
msgid ""
249
267
"This exception is raised when the :meth:`~Queue.get_nowait` method is called "
250
268
"on an empty queue."
251
269
msgstr "當佇列為空的時候,呼叫 :meth:`~Queue.get_nowait` 方法會引發這個例外。"
252
270
253
- #: ../../library/asyncio-queue.rst:171
271
+ #: ../../library/asyncio-queue.rst:184
254
272
msgid ""
255
273
"Exception raised when the :meth:`~Queue.put_nowait` method is called on a "
256
274
"queue that has reached its *maxsize*."
257
275
msgstr ""
258
276
"當佇列中條目數量已經達到它的 *maxsize* 時,呼叫 :meth:`~Queue.put_nowait` 方"
259
277
"法會引發這個例外。"
260
278
261
- #: ../../library/asyncio-queue.rst:177
279
+ #: ../../library/asyncio-queue.rst:190
262
280
msgid ""
263
281
"Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on "
264
282
"a queue which has been shut down."
265
283
msgstr ""
266
284
267
- #: ../../library/asyncio-queue.rst:184
285
+ #: ../../library/asyncio-queue.rst:197
268
286
msgid "Examples"
269
287
msgstr "範例"
270
288
271
- #: ../../library/asyncio-queue.rst:188
289
+ #: ../../library/asyncio-queue.rst:201
272
290
msgid ""
273
291
"Queues can be used to distribute workload between several concurrent tasks::"
274
292
msgstr "佇列能被用於多個並行任務的工作分配:"
275
293
276
- #: ../../library/asyncio-queue.rst:191
294
+ #: ../../library/asyncio-queue.rst:204
277
295
msgid ""
278
296
"import asyncio\n"
279
297
"import random\n"
0 commit comments