11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2018 , Python Software Foundation
2+ # Copyright (C) 2001-2019 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
99# ww song <[email protected] >, 201810101111# Danny Vi <[email protected] >, 201812- # Freesand Leo <[email protected] >, 2018 12+ # Freesand Leo <[email protected] >, 2019 1313#
1414#, fuzzy
1515msgid ""
1616msgstr ""
1717"Project-Id-Version : Python 3.7\n "
1818"Report-Msgid-Bugs-To : \n "
19- "POT-Creation-Date : 2018-12-20 10:06 +0900\n "
19+ "POT-Creation-Date : 2019-01-01 10:14 +0900\n "
2020"PO-Revision-Date : 2017-02-16 23:38+0000\n "
21- "
Last-Translator :
Freesand Leo <[email protected] >, 2018 \n "
21+ "
Last-Translator :
Freesand Leo <[email protected] >, 2019 \n "
2222"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2323"MIME-Version : 1.0\n "
2424"Content-Type : text/plain; charset=UTF-8\n "
@@ -768,6 +768,8 @@ msgid ""
768768":keyword:`async def` further defines the function as a :term:`asynchronous "
769769"generator` function."
770770msgstr ""
771+ "在一个使用 :keyword:`async def` 定义的函数或方法出现的 yield 表达式会进一步将该函数定义为一个 "
772+ ":term:`asynchronous generator` 函数。"
771773
772774#: ../../reference/expressions.rst:619
773775msgid ""
@@ -778,6 +780,8 @@ msgid ""
778780" coroutine function analogously to how a generator object would be used in a"
779781" :keyword:`for` statement."
780782msgstr ""
783+ "当一个异步生成器函数被调用时,它会返回一个名为异步生成器对象的异步迭代器。 此对象将在之后控制该生成器函数的执行。 异步生成器对象通常被用在协程函数的 "
784+ ":keyword:`async for` 语句中,类似于在 :keyword:`for` 语句中使用生成器对象。"
781785
782786#: ../../reference/expressions.rst:626
783787msgid ""
@@ -797,6 +801,12 @@ msgid ""
797801"Otherwise, if :meth:`~agen.asend` is used, then the result will be the value"
798802" passed in to that method."
799803msgstr ""
804+ "调用异步生成器的方法之一将返回 :term:`awaitable` 对象,执行会在此对象被等待时启动。 到那时,执行将前往第一个 yield "
805+ "表达式,在那里它会再次暂停,将 :token:`expression_list` 的值返回给等待中的协程。 "
806+ "与生成器一样,挂起意味着局部的所有状态会被保留,包括局部变量的当前绑定、指令的指针、内部求值的堆栈以及任何异常处理的状态。 "
807+ "当执行在等待异步生成器的方法返回下一个对象后恢复时,该函数可以从原状态继续进行,就仿佛 yield 表达式只是另一个外部调用。 恢复执行之后 yield"
808+ " 表达式的值取决于恢复执行所用的方法。 如果使用 :meth:`~agen.__anext__` 则结果为 :const:`None`。 "
809+ "否则的话,如果使用 :meth:`~agen.asend` 则结果将是传递给该方法的值。"
800810
801811#: ../../reference/expressions.rst:642
802812msgid ""
@@ -811,6 +821,11 @@ msgid ""
811821"the resulting coroutine object, thus allowing any pending "
812822":keyword:`!finally` clauses to execute."
813823msgstr ""
824+ "在异步生成器函数中,yield 表达式允许出现在 :keyword:`try` 结构的任何位置。 "
825+ "但是,如果一个异步生成器在其被终结(由于引用计数达到零或被作为垃圾回收)之前未被恢复,则then a yield expression within a"
826+ " :keyword:`!try` 结构中的 yield 表达式可能导致挂起的 :keyword:`finally` 子句执行失败。 在此情况下"
827+ ",应由运行该异步生成器的事件循环或任务调度器来负责调用异步生成器-迭代器的 :meth:`~agen.aclose` "
828+ "方法并运行所返回的协程对象,从而允许任何挂起的 :keyword:`!finally` 子句得以执行。"
814829
815830#: ../../reference/expressions.rst:653
816831msgid ""
0 commit comments