@@ -394,126 +394,135 @@ msgstr "如果希望完全忽略取消操作 (不推荐) 则 ``shield()`` 函数
394394
395395#: ../../library/asyncio-task.rst:410
396396msgid "Timeouts"
397- msgstr ""
397+ msgstr "超时 "
398398
399399#: ../../library/asyncio-task.rst:414
400400msgid ""
401401"Wait for the *aw* :ref:`awaitable <asyncio-awaitables>` to complete with a "
402402"timeout."
403- msgstr ""
403+ msgstr "等待 *aw* :ref:`可等待对象 <asyncio-awaitables>` 完成,指定 timeout 秒数后超时。 "
404404
405405#: ../../library/asyncio-task.rst:419
406406msgid ""
407407"*timeout* can either be ``None`` or a float or int number of seconds to wait"
408408" for. If *timeout* is ``None``, block until the future completes."
409409msgstr ""
410+ "*timeout* 可以为 ``None``,也可以为 float 或 int 型数值表示的等待秒数。如果 *timeout* 为 "
411+ "``None``,则等待直到完成。"
410412
411413#: ../../library/asyncio-task.rst:423
412414msgid ""
413415"If a timeout occurs, it cancels the task and raises "
414416":exc:`asyncio.TimeoutError`."
415- msgstr ""
417+ msgstr "如果发生超时,任务将取消并引发 :exc:`asyncio.TimeoutError`. "
416418
417419#: ../../library/asyncio-task.rst:426
418420msgid ""
419421"To avoid the task :meth:`cancellation <Task.cancel>`, wrap it in "
420422":func:`shield`."
421- msgstr ""
423+ msgstr "要避免任务 :meth:`取消 <Task.cancel>`,可以加上 :func:`shield`。 "
422424
423425#: ../../library/asyncio-task.rst:429
424426msgid ""
425427"The function will wait until the future is actually cancelled, so the total "
426428"wait time may exceed the *timeout*."
427- msgstr ""
429+ msgstr "函数将等待直到目标对象确实被取消,所以总等待时间可能超过 *timeout* 指定的秒数。 "
428430
429431#: ../../library/asyncio-task.rst:432
430432msgid "If the wait is cancelled, the future *aw* is also cancelled."
431- msgstr ""
433+ msgstr "如果等待被取消,则 *aw* 指定的对象也会被取消。 "
432434
433435#: ../../library/asyncio-task.rst:459
434436msgid ""
435437"When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be "
436438"cancelled. Previously, it raised :exc:`asyncio.TimeoutError` immediately."
437439msgstr ""
440+ "当 *aw* 因超时被取消,``wait_for`` 会等待 *aw* 被取消。之前版本则将立即引发 "
441+ ":exc:`asyncio.TimeoutError`。"
438442
439443#: ../../library/asyncio-task.rst:466
440444msgid "Waiting Primitives"
441- msgstr ""
445+ msgstr "简单等待 "
442446
443447#: ../../library/asyncio-task.rst:471
444448msgid ""
445449"Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws* set "
446450"concurrently and block until the condition specified by *return_when*."
447451msgstr ""
452+ "并发运行 *aws* 指定的 :ref:`可等待对象 <asyncio-awaitables>` 并阻塞线程直到满足 *return_when* "
453+ "指定的条件。"
448454
449455#: ../../library/asyncio-task.rst:475
450456msgid ""
451457"If any awaitable in *aws* is a coroutine, it is automatically scheduled as a"
452458" Task. Passing coroutines objects to ``wait()`` directly is deprecated as "
453459"it leads to :ref:`confusing behavior <asyncio_example_wait_coroutine>`."
454460msgstr ""
461+ "如果 *aws* 中的某个可等待对象为协程,它将自动作为任务加入日程。直接向 ``wait()`` 传入协程对象已弃用,因为这会导致 "
462+ ":ref:`令人迷惑的行为 <asyncio_example_wait_coroutine>`。"
455463
456464#: ../../library/asyncio-task.rst:480
457465msgid "Returns two sets of Tasks/Futures: ``(done, pending)``."
458- msgstr ""
466+ msgstr "返回两个 Task/Future 集合: ``(done, pending)``。 "
459467
460468#: ../../library/asyncio-task.rst:482
461469msgid "Usage::"
462- msgstr ""
470+ msgstr "用法:: "
463471
464472#: ../../library/asyncio-task.rst:489
465473msgid ""
466474"*timeout* (a float or int), if specified, can be used to control the maximum"
467475" number of seconds to wait before returning."
468- msgstr ""
476+ msgstr "如指定 *timeout* (float 或 int 类型) 则它将被用于控制返回之前等待的最长秒数。 "
469477
470478#: ../../library/asyncio-task.rst:492
471479msgid ""
472480"Note that this function does not raise :exc:`asyncio.TimeoutError`. Futures "
473481"or Tasks that aren't done when the timeout occurs are simply returned in the"
474482" second set."
475483msgstr ""
484+ "请注意此函数不会引发 :exc:`asyncio.TimeoutError`。当超时发生时,未完成的 Future 或 Task 将在指定秒数后被返回。"
476485
477486#: ../../library/asyncio-task.rst:496
478487msgid ""
479488"*return_when* indicates when this function should return. It must be one of"
480489" the following constants:"
481- msgstr ""
490+ msgstr "*return_when* 指定此函数应在何时返回。它必须为以下常数之一: "
482491
483492#: ../../library/asyncio-task.rst:502
484493msgid "Constant"
485- msgstr ""
494+ msgstr "常数 "
486495
487496#: ../../library/asyncio-task.rst:502
488497msgid "Description"
489498msgstr "描述"
490499
491500#: ../../library/asyncio-task.rst:504
492501msgid ":const:`FIRST_COMPLETED`"
493- msgstr ""
502+ msgstr ":const:`FIRST_COMPLETED` "
494503
495504#: ../../library/asyncio-task.rst:504
496505msgid "The function will return when any future finishes or is cancelled."
497- msgstr ""
506+ msgstr "函数将在任意可等待对象结束或取消时返回。 "
498507
499508#: ../../library/asyncio-task.rst:507
500509msgid ":const:`FIRST_EXCEPTION`"
501- msgstr ""
510+ msgstr ":const:`FIRST_EXCEPTION` "
502511
503512#: ../../library/asyncio-task.rst:507
504513msgid ""
505514"The function will return when any future finishes by raising an exception. "
506515"If no future raises an exception then it is equivalent to "
507516":const:`ALL_COMPLETED`."
508- msgstr ""
517+ msgstr "函数将在任意可等待对象因引发异常而结束时返回。当没有引发任何异常时它就相当于 :const:`ALL_COMPLETED`。 "
509518
510519#: ../../library/asyncio-task.rst:513
511520msgid ":const:`ALL_COMPLETED`"
512- msgstr ""
521+ msgstr ":const:`ALL_COMPLETED` "
513522
514523#: ../../library/asyncio-task.rst:513
515524msgid "The function will return when all futures finish or are cancelled."
516- msgstr ""
525+ msgstr "函数将在所有可等待对象结束或取消时返回。 "
517526
518527#: ../../library/asyncio-task.rst:517
519528msgid ""
0 commit comments