8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.13\n "
10
10
"Report-Msgid-Bugs-To : \n "
11
- "POT-Creation-Date : 2025-01-10 00:14 +0000\n "
11
+ "POT-Creation-Date : 2025-02-23 00:15 +0000\n "
12
12
"PO-Revision-Date : 2022-02-20 18:34+0800\n "
13
13
"
Last-Translator :
Matt Wang <[email protected] >\n "
14
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -39,8 +39,8 @@ msgstr ""
39
39
40
40
#: ../../library/asyncio-queue.rst:17
41
41
msgid ""
42
- "Note that methods of asyncio queues don't have a *timeout* parameter; "
43
- "use : func:`asyncio.wait_for` function to do queue operations with a timeout."
42
+ "Note that methods of asyncio queues don't have a *timeout* parameter; use : "
43
+ "func:`asyncio.wait_for` function to do queue operations with a timeout."
44
44
msgstr ""
45
45
"注意 asyncio 的佇列沒有 *timeout* 參數;請使用 :func:`asyncio.wait_for` 函式"
46
46
"來為佇列新增具有超時 (timeout) 設定的操作。"
@@ -64,8 +64,8 @@ msgid ""
64
64
"queue reaches *maxsize* until an item is removed by :meth:`get`."
65
65
msgstr ""
66
66
"如果 *maxsize* 小於或等於零,則佇列大小是無限制的。如果是大於 ``0`` 的整數,"
67
- "則當佇列達到 *maxsize* 時,``await put()`` 將會阻塞 (block),直到某個元素 "
68
- "被 : meth:`get` 取出。"
67
+ "則當佇列達到 *maxsize* 時,``await put()`` 將會阻塞 (block),直到某個元素被 : "
68
+ "meth:`get` 取出。"
69
69
70
70
#: ../../library/asyncio-queue.rst:35
71
71
msgid ""
@@ -97,105 +97,105 @@ msgstr "如果有 :attr:`maxsize` 個條目在佇列中,則回傳 ``True``。"
97
97
98
98
#: ../../library/asyncio-queue.rst:57
99
99
msgid ""
100
- "If the queue was initialized with ``maxsize=0`` (the default), "
101
- "then :meth: `full` never returns ``True``."
100
+ "If the queue was initialized with ``maxsize=0`` (the default), then :meth: "
101
+ "`full` never returns ``True``."
102
102
msgstr ""
103
103
"如果佇列用 ``maxsize=0`` (預設)初始化,則 :meth:`full` 永遠不會回傳 "
104
104
"``True``。"
105
105
106
- #: ../../library/asyncio-queue.rst:62
106
+ #: ../../library/asyncio-queue.rst:63
107
107
msgid ""
108
108
"Remove and return an item from the queue. If queue is empty, wait until an "
109
109
"item is available."
110
110
msgstr "從佇列中刪除並回傳一個元素。如果佇列為空,則持續等待直到佇列中有元素。"
111
111
112
- #: ../../library/asyncio-queue.rst:65
112
+ #: ../../library/asyncio-queue.rst:66
113
113
msgid ""
114
114
"Raises :exc:`QueueShutDown` if the queue has been shut down and is empty, or "
115
115
"if the queue has been shut down immediately."
116
116
msgstr ""
117
117
118
- #: ../../library/asyncio-queue.rst:70
118
+ #: ../../library/asyncio-queue.rst:71
119
119
msgid ""
120
120
"Return an item if one is immediately available, else raise :exc:`QueueEmpty`."
121
121
msgstr "如果佇列內有值則立即回傳佇列中的元素,否則引發 :exc:`QueueEmpty`。"
122
122
123
- #: ../../library/asyncio-queue.rst:75
123
+ #: ../../library/asyncio-queue.rst:77
124
124
msgid "Block until all items in the queue have been received and processed."
125
125
msgstr "持續阻塞直到佇列中所有的元素都被接收和處理完畢。"
126
126
127
- #: ../../library/asyncio-queue.rst:77
127
+ #: ../../library/asyncio-queue.rst:79
128
128
msgid ""
129
129
"The count of unfinished tasks goes up whenever an item is added to the "
130
- "queue. The count goes down whenever a consumer coroutine "
131
- "calls :meth: `task_done` to indicate that the item was retrieved and all work "
132
- "on it is complete. When the count of unfinished tasks drops to "
133
- "zero, :meth:`join` unblocks."
130
+ "queue. The count goes down whenever a consumer coroutine calls :meth: "
131
+ "`task_done` to indicate that the item was retrieved and all work on it is "
132
+ "complete. When the count of unfinished tasks drops to zero, :meth:`join` "
133
+ "unblocks."
134
134
msgstr ""
135
135
"當條目新增到佇列的時候,未完成任務的計數就會增加。每當一個消耗者 (consumer) "
136
136
"協程呼叫 :meth:`task_done`,表示這個條目已經被取回且被它包含的所有工作都已完"
137
137
"成,未完成任務計數就會減少。當未完成計數降到零的時候,:meth:`join` 阻塞會被解"
138
138
"除 (unblock)。"
139
139
140
- #: ../../library/asyncio-queue.rst:85
140
+ #: ../../library/asyncio-queue.rst:88
141
141
msgid ""
142
142
"Put an item into the queue. If the queue is full, wait until a free slot is "
143
143
"available before adding the item."
144
144
msgstr ""
145
145
"將一個元素放進佇列。如果佇列滿了,在新增元素之前,會持續等待直到有空閒插槽 "
146
146
"(free slot) 能被使用。"
147
147
148
- #: ../../library/asyncio-queue.rst:88
148
+ #: ../../library/asyncio-queue.rst:91
149
149
msgid "Raises :exc:`QueueShutDown` if the queue has been shut down."
150
150
msgstr "如果佇列已經被關閉,則引發 :exc:`QueueShutDown`。"
151
151
152
- #: ../../library/asyncio-queue.rst:92
152
+ #: ../../library/asyncio-queue.rst:95
153
153
msgid "Put an item into the queue without blocking."
154
154
msgstr "不阻塞地將一個元素放入佇列。"
155
155
156
- #: ../../library/asyncio-queue.rst:94
156
+ #: ../../library/asyncio-queue.rst:97
157
157
msgid "If no free slot is immediately available, raise :exc:`QueueFull`."
158
158
msgstr "如果沒有立即可用的空閒插槽,引發 :exc:`QueueFull`。"
159
159
160
- #: ../../library/asyncio-queue.rst:98
160
+ #: ../../library/asyncio-queue.rst:101
161
161
msgid "Return the number of items in the queue."
162
162
msgstr "回傳佇列中的元素數量。"
163
163
164
- #: ../../library/asyncio-queue.rst:102
164
+ #: ../../library/asyncio-queue.rst:105
165
165
msgid ""
166
- "Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` "
167
- "raise : exc:`QueueShutDown`."
166
+ "Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` raise : "
167
+ "exc:`QueueShutDown`."
168
168
msgstr ""
169
169
170
- #: ../../library/asyncio-queue.rst:105
170
+ #: ../../library/asyncio-queue.rst:108
171
171
msgid ""
172
172
"By default, :meth:`~Queue.get` on a shut down queue will only raise once the "
173
173
"queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise "
174
174
"immediately instead."
175
175
msgstr ""
176
176
177
- #: ../../library/asyncio-queue.rst:109
177
+ #: ../../library/asyncio-queue.rst:112
178
178
msgid ""
179
179
"All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be "
180
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 "
182
- "of :meth:`~Queue. join`."
181
+ "remaining item in the queue, which may unblock callers of :meth:`~Queue. "
182
+ "join`."
183
183
msgstr ""
184
184
185
- #: ../../library/asyncio-queue.rst:118
185
+ #: ../../library/asyncio-queue.rst:121
186
186
msgid "Indicate that a formerly enqueued work item is complete."
187
187
msgstr "表示前面一個排隊的工作項目已經完成。"
188
188
189
- #: ../../library/asyncio-queue.rst:120
189
+ #: ../../library/asyncio-queue.rst:123
190
190
msgid ""
191
191
"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work "
192
192
"item, a subsequent call to :meth:`task_done` tells the queue that the "
193
193
"processing on the work item is complete."
194
194
msgstr ""
195
- "由佇列消耗者使用。對於每個用於獲取一個工作項目的 :meth:`~Queue.get`,接續 "
196
- "的 : meth:`task_done` 呼叫會告訴佇列這個工作項目的處理已經完成。"
195
+ "由佇列消耗者使用。對於每個用於獲取一個工作項目的 :meth:`~Queue.get`,接續的 : "
196
+ "meth:`task_done` 呼叫會告訴佇列這個工作項目的處理已經完成。"
197
197
198
- #: ../../library/asyncio-queue.rst:124
198
+ #: ../../library/asyncio-queue.rst:127
199
199
msgid ""
200
200
"If a :meth:`join` is currently blocking, it will resume when all items have "
201
201
"been processed (meaning that a :meth:`task_done` call was received for every "
@@ -204,76 +204,76 @@ msgstr ""
204
204
"如果 :meth:`join` 當前正在阻塞,在所有項目都被處理後會解除阻塞(意味著每個"
205
205
"以 :meth:`~Queue.put` 放進佇列的條目都會收到一個 :meth:`task_done`)。"
206
206
207
- #: ../../library/asyncio-queue.rst:129
207
+ #: ../../library/asyncio-queue.rst:132
208
208
msgid ""
209
209
"``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item "
210
210
"in the queue."
211
211
msgstr ""
212
212
213
- #: ../../library/asyncio-queue.rst:132
213
+ #: ../../library/asyncio-queue.rst:135
214
214
msgid ""
215
215
"Raises :exc:`ValueError` if called more times than there were items placed "
216
216
"in the queue."
217
217
msgstr "如果被呼叫的次數多於放入佇列中的項目數量,將引發 :exc:`ValueError`。"
218
218
219
- #: ../../library/asyncio-queue.rst:137
219
+ #: ../../library/asyncio-queue.rst:140
220
220
msgid "Priority Queue"
221
221
msgstr "Priority Queue(優先佇列)"
222
222
223
- #: ../../library/asyncio-queue.rst:141
223
+ #: ../../library/asyncio-queue.rst:144
224
224
msgid ""
225
225
"A variant of :class:`Queue`; retrieves entries in priority order (lowest "
226
226
"first)."
227
227
msgstr ":class:`Queue` 的變形;按優先順序取出條目 (最小的先取出)。"
228
228
229
- #: ../../library/asyncio-queue.rst:144
229
+ #: ../../library/asyncio-queue.rst:147
230
230
msgid "Entries are typically tuples of the form ``(priority_number, data)``."
231
231
msgstr "條目通常是 ``(priority_number, data)`` 形式的 tuple(元組)。"
232
232
233
- #: ../../library/asyncio-queue.rst:149
233
+ #: ../../library/asyncio-queue.rst:152
234
234
msgid "LIFO Queue"
235
235
msgstr "LIFO Queue"
236
236
237
- #: ../../library/asyncio-queue.rst:153
237
+ #: ../../library/asyncio-queue.rst:156
238
238
msgid ""
239
239
"A variant of :class:`Queue` that retrieves most recently added entries first "
240
240
"(last in, first out)."
241
241
msgstr ":class:`Queue` 的變形,先取出最近新增的條目(後進先出)。"
242
242
243
- #: ../../library/asyncio-queue.rst:158
243
+ #: ../../library/asyncio-queue.rst:161
244
244
msgid "Exceptions"
245
245
msgstr "例外"
246
246
247
- #: ../../library/asyncio-queue.rst:162
247
+ #: ../../library/asyncio-queue.rst:165
248
248
msgid ""
249
249
"This exception is raised when the :meth:`~Queue.get_nowait` method is called "
250
250
"on an empty queue."
251
251
msgstr "當佇列為空的時候,呼叫 :meth:`~Queue.get_nowait` 方法會引發這個例外。"
252
252
253
- #: ../../library/asyncio-queue.rst:168
253
+ #: ../../library/asyncio-queue.rst:171
254
254
msgid ""
255
255
"Exception raised when the :meth:`~Queue.put_nowait` method is called on a "
256
256
"queue that has reached its *maxsize*."
257
257
msgstr ""
258
258
"當佇列中條目數量已經達到它的 *maxsize* 時,呼叫 :meth:`~Queue.put_nowait` 方"
259
259
"法會引發這個例外。"
260
260
261
- #: ../../library/asyncio-queue.rst:174
261
+ #: ../../library/asyncio-queue.rst:177
262
262
msgid ""
263
263
"Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on "
264
264
"a queue which has been shut down."
265
265
msgstr ""
266
266
267
- #: ../../library/asyncio-queue.rst:181
267
+ #: ../../library/asyncio-queue.rst:184
268
268
msgid "Examples"
269
269
msgstr "範例"
270
270
271
- #: ../../library/asyncio-queue.rst:185
271
+ #: ../../library/asyncio-queue.rst:188
272
272
msgid ""
273
273
"Queues can be used to distribute workload between several concurrent tasks::"
274
274
msgstr "佇列能被用於多個並行任務的工作分配:"
275
275
276
- #: ../../library/asyncio-queue.rst:188
276
+ #: ../../library/asyncio-queue.rst:191
277
277
msgid ""
278
278
"import asyncio\n"
279
279
"import random\n"
0 commit comments