@@ -680,7 +680,7 @@ msgstr "这个子小节描述了生成器迭代器的方法。 它们可被用
680680msgid ""
681681"Note that calling any of the generator methods below when the generator is "
682682"already executing raises a :exc:`ValueError` exception."
683- msgstr ""
683+ msgstr "请注意在生成器已经在执行时调用以下任何方法都会引发 :exc:`ValueError` 异常。 "
684684
685685#: ../../reference/expressions.rst:530
686686msgid ""
@@ -693,12 +693,16 @@ msgid ""
693693"generator exits without yielding another value, a :exc:`StopIteration` "
694694"exception is raised."
695695msgstr ""
696+ "开始一个生成器函数的执行或是从上次执行的 yield 表达式位置恢复执行。 当一个生成器函数通过 :meth:`~generator.__next__`"
697+ " 方法恢复执行时,当前的 yield 表达式总是取值为 :const:`None`。 随后会继续执行到下一个 yield 表达式,其 "
698+ ":token:`expression_list` 的值会返回给 :meth:`__next__` 的调用者。 如果生成器没有产生下一个值就退出,则将引发"
699+ " :exc:`StopIteration` 异常。"
696700
697701#: ../../reference/expressions.rst:539
698702msgid ""
699703"This method is normally called implicitly, e.g. by a :keyword:`for` loop, or"
700704" by the built-in :func:`next` function."
701- msgstr ""
705+ msgstr "此方法通常是隐式地调用,例如通过 :keyword:`for` 循环或是内置的 :func:`next` 函数。 "
702706
703707#: ../../reference/expressions.rst:545
704708msgid ""
@@ -710,6 +714,9 @@ msgid ""
710714"called with :const:`None` as the argument, because there is no yield "
711715"expression that could receive the value."
712716msgstr ""
717+ "恢复执行并向生成器函数“发送”一个值。 *value* 参数将成为当前 yield 表达式的结果。 :meth:`send` "
718+ "方法会返回生成器所产生的下一个值,或者如果生成器没有产生下一个值就退出则会引发 :exc:`StopIteration`。 当调用 "
719+ ":meth:`send` 来启动生成器时,它必须以 :const:`None` 作为调用参数,因为这时没有可以接收值的 yield 表达式。"
713720
714721#: ../../reference/expressions.rst:556
715722msgid ""
0 commit comments