@@ -287,20 +287,20 @@ msgstr "并发运行任务"
287287msgid ""
288288"Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws* sequence "
289289"*concurrently*."
290- msgstr ""
290+ msgstr "*并发* 运行 *aws* 序列中的 :ref:`可等待对象 <asyncio-awaitables>`。 "
291291
292292#: ../../library/asyncio-task.rst:307
293293msgid ""
294294"If any awaitable in *aws* is a coroutine, it is automatically scheduled as a"
295295" Task."
296- msgstr ""
296+ msgstr "如果 *aws* 中的某个可等待对象为协程,它将自动作为一个任务加入日程。 "
297297
298298#: ../../library/asyncio-task.rst:310
299299msgid ""
300300"If all awaitables are completed successfully, the result is an aggregate "
301301"list of returned values. The order of result values corresponds to the "
302302"order of awaitables in *aws*."
303- msgstr ""
303+ msgstr "如果所有可等待对象都成功完成,结果将是一个由所有返回值聚合而成的列表。结果值的顺序与 *aws* 中可等待对象的顺序一致。 "
304304
305305#: ../../library/asyncio-task.rst:314
306306msgid ""
@@ -309,18 +309,20 @@ msgid ""
309309"awaitables in the *aws* sequence **won't be cancelled** and will continue to"
310310" run."
311311msgstr ""
312+ "如果 *return_exceptions* 为 ``False`` (默认),所引发的首个异常会立即传播给等待 ``gather()`` "
313+ "的任务。*aws* 序列中的其他可等待对象 **不会被取消** 并将继续运行。"
312314
313315#: ../../library/asyncio-task.rst:319
314316msgid ""
315317"If *return_exceptions* is ``True``, exceptions are treated the same as "
316318"successful results, and aggregated in the result list."
317- msgstr ""
319+ msgstr "如果 *return_exceptions* 为 ``True``,异常会和成功的结果一样处理,并聚合至结果列表。 "
318320
319321#: ../../library/asyncio-task.rst:322
320322msgid ""
321323"If ``gather()`` is *cancelled*, all submitted awaitables (that have not "
322324"completed yet) are also *cancelled*."
323- msgstr ""
325+ msgstr "如果 ``gather()`` *被取消*,所有被提交 (尚未完成) 的可等待对象也会 *被取消*。 "
324326
325327#: ../../library/asyncio-task.rst:325
326328msgid ""
@@ -329,39 +331,42 @@ msgid ""
329331"cancelled in this case. This is to prevent the cancellation of one "
330332"submitted Task/Future to cause other Tasks/Futures to be cancelled."
331333msgstr ""
334+ "如果 *aws* 序列中的任一 Task 或 Future 对象 *被取消*,它将被当作引发了 :exc:`CancelledError` 一样处理 "
335+ "-- 在此情况下 ``gather()`` 调用 **不会** 被取消。这是为了防止一个已提交的 Task/Future 被取消导致其他 "
336+ "Tasks/Future 也被取消。"
332337
333338#: ../../library/asyncio-task.rst:333 ../../library/asyncio-task.rst:439
334339#: ../../library/asyncio-task.rst:561
335340msgid "Example::"
336- msgstr ""
341+ msgstr "示例:: "
337342
338343#: ../../library/asyncio-task.rst:367
339344msgid ""
340345"If the *gather* itself is cancelled, the cancellation is propagated "
341346"regardless of *return_exceptions*."
342- msgstr ""
347+ msgstr "如果 *gather* 本身被取消,则无论 *return_exceptions* 取值为何,消息都会被传播。 "
343348
344349#: ../../library/asyncio-task.rst:373
345350msgid "Shielding From Cancellation"
346- msgstr ""
351+ msgstr "屏蔽取消操作 "
347352
348353#: ../../library/asyncio-task.rst:377
349354msgid ""
350355"Protect an :ref:`awaitable object <asyncio-awaitables>` from being "
351356":meth:`cancelled <Task.cancel>`."
352- msgstr ""
357+ msgstr "保护一个 :ref:`可等待对象 <asyncio-awaitables>` 防止其被 :meth:`取消 <Task.cancel>`。 "
353358
354359#: ../../library/asyncio-task.rst:380 ../../library/asyncio-task.rst:417
355360msgid "If *aw* is a coroutine it is automatically scheduled as a Task."
356- msgstr ""
361+ msgstr "如果 *aw* 是一个协程,它将自动作为任务加入日程。 "
357362
358363#: ../../library/asyncio-task.rst:382
359364msgid "The statement::"
360- msgstr ""
365+ msgstr "以下语句:: "
361366
362367#: ../../library/asyncio-task.rst:386
363368msgid "is equivalent to::"
364- msgstr ""
369+ msgstr "相当于:: "
365370
366371#: ../../library/asyncio-task.rst:390
367372msgid ""
@@ -371,19 +376,21 @@ msgid ""
371376"still cancelled, so the \" await\" expression still raises a "
372377":exc:`CancelledError`."
373378msgstr ""
379+ "*不同之处* 在于如果包含它的协程被取消,在 ``something()`` 中运行的任务不会被取消。从 ``something()`` "
380+ "的角度看来,取消操作并没有发生。然而其调用者已被取消,因此 \" await\" 表达式仍然会引发 :exc:`CancelledError`。"
374381
375382#: ../../library/asyncio-task.rst:396
376383msgid ""
377384"If ``something()`` is cancelled by other means (i.e. from within itself) "
378385"that would also cancel ``shield()``."
379- msgstr ""
386+ msgstr "如果通过其他方式取消 ``something()`` (例如在其内部操作) 则 ``shield()`` 也会取消。 "
380387
381388#: ../../library/asyncio-task.rst:399
382389msgid ""
383390"If it is desired to completely ignore cancellation (not recommended) the "
384391"``shield()`` function should be combined with a try/except clause, as "
385392"follows::"
386- msgstr ""
393+ msgstr "如果希望完全忽略取消操作 (不推荐) 则 ``shield()`` 函数需要配合一个 try/except 代码段,如下所示:: "
387394
388395#: ../../library/asyncio-task.rst:410
389396msgid "Timeouts"
0 commit comments