@@ -260,7 +260,7 @@ msgid ""
260260" This ensures that names assigned to in the target list don't \" leak\" into "
261261"the enclosing scope."
262262msgstr ""
263- "なお 、最も左にある :keyword:`!for` 節のイテラブル式を除いて、内包表記は暗黙的にネストされた個別のスコープで実行されます。\n"
263+ "ただし 、最も左にある :keyword:`!for` 節のイテラブル式を除いて、内包表記は暗黙的にネストされた個別のスコープで実行されます。\n"
264264"この仕組みのおかげで、対象のリスト内で代入された名前が外側のスコープに \" 漏れる\" ことはありません。"
265265
266266#: ../../reference/expressions.rst:198
@@ -272,6 +272,9 @@ msgid ""
272272"enclosing scope as they may depend on the values obtained from the leftmost "
273273"iterable. For example: ``[x*y for x in range(10) for y in range(x, x+10)]``."
274274msgstr ""
275+ "最も左にある :keyword:`!for` 節のイテラブル式は、それを直接囲んでいるスコープでそのまま評価され、暗黙的な入れ子のスコープに引数として渡されます。\n"
276+ "後に続く :keyword:`!for` 節と、最も左にある :keyword:`!for` 節のフィルター条件はイテラブル式を直接囲んでいるスコープでは評価できません。というのは、それらは最も左のイテラブルから得られる値に依存しているかもしれないからです。\n"
277+ "例えば次の通りです: ``[x*y for x in range(10) for y in range(x, x+10)]`` 。"
275278
276279#: ../../reference/expressions.rst:205
277280msgid ""
@@ -281,6 +284,10 @@ msgid ""
281284":exc:`DeprecationWarning` when compiled, in Python 3.8+ they will emit "
282285":exc:`SyntaxError`)."
283286msgstr ""
287+ "内包表記が常に適切な型のコンテナになるのを保証するために、 ``yield`` 式や ``yield from`` "
288+ "式は暗黙的な入れ子のスコープでは禁止されています (Python 3.7 では、そのような式はコンパイル時に "
289+ ":exc:`DeprecationWarning` を発生させ、 Python 3.8 以降では :exc:`SyntaxError` "
290+ "を発生させます)。"
284291
285292#: ../../reference/expressions.rst:213
286293msgid ""
@@ -295,6 +302,11 @@ msgid ""
295302"asynchronous comprehension may suspend the execution of the coroutine "
296303"function in which it appears. See also :pep:`530`."
297304msgstr ""
305+ "Python 3.6 から、 :keyword:`async def` 関数では :keyword:`!async for` 節が :term:`asynchronous iterator` の反復処理をするのに使われることがありました。\n"
306+ ":keyword:`!async def` 関数に含まれる内包表記が、先頭の式に続く :keyword:`!for` 節あるいは :keyword:`!async for` 節で構成されていることや、追加の :keyword:`!for` 節あるいは :keyword:`!async for` 節を含んでいること、そのうえ :keyword:`await` 式を使っていることがあるかもしれません。\n"
307+ "内包表記が :keyword:`!async for` 節あるいは :keyword:`!await` 式を含んでいる場合、それは :dfn:`非同期内包表記` と呼ばれます。\n"
308+ "非同期内包表記は、それが現れるコルーチン関数の実行を中断させるかもしれません。\n"
309+ ":pep:`530` も参照してください。"
298310
299311#: ../../reference/expressions.rst:225
300312msgid "Asynchronous comprehensions were introduced."
@@ -303,7 +315,7 @@ msgstr "非同期内包表記が導入されました。"
303315#: ../../reference/expressions.rst:228 ../../reference/expressions.rst:395
304316msgid ""
305317"``yield`` and ``yield from`` deprecated in the implicitly nested scope."
306- msgstr ""
318+ msgstr "``yield`` および ``yield from`` は暗黙的な入れ子のスコープでは非推奨となりました。 "
307319
308320#: ../../reference/expressions.rst:235
309321msgid "List displays"
@@ -395,7 +407,7 @@ msgstr ""
395407
396408#: ../../reference/expressions.rst:324
397409msgid "Unpacking into dictionary displays, originally proposed by :pep:`448`."
398- msgstr ""
410+ msgstr "辞書表示のアンパッキングは最初に :pep:`448` で提案されました。 "
399411
400412#: ../../reference/expressions.rst:327
401413msgid ""
@@ -447,6 +459,10 @@ msgid ""
447459"scope as they may depend on the values obtained from the leftmost iterable. "
448460"For example: ``(x*y for x in range(10) for y in range(x, x+10))``."
449461msgstr ""
462+ "ジェネレータ式の中で使われている変数は、 (通常のジェネレータと同じように) そのジェネレータオブジェクトに対して :meth:`~generator.__next__` メソッドが呼ばれるときまで評価が遅延されます。\n"
463+ "ただし、最も左にある :keyword:`!for` 節のイテラブル式は直ちに評価されます。そのためそこで生じたエラーは、最初の値が得られた時点ではなく、ジェネレータ式が定義された時点で発せられます。\n"
464+ "後に続く :keyword:`!for` 節と、最も左にある :keyword:`!for` 節のフィルター条件はイテラブル式を直接囲んでいるスコープでは評価できません。というのは、それらは最も左のイテラブルから得られる値に依存しているかもしれないからです。\n"
465+ "例えば次の通りです: ``(x*y for x in range(10) for y in range(x, x+10))`` 。"
450466
451467#: ../../reference/expressions.rst:372
452468msgid ""
@@ -462,6 +478,10 @@ msgid ""
462478":exc:`DeprecationWarning` when compiled, in Python 3.8+ they will emit "
463479":exc:`SyntaxError`)."
464480msgstr ""
481+ "ジェネレータ式自身の期待される動作を妨げないために、 ``yield`` 式や ``yield from`` "
482+ "式は暗黙的に定義されたジェネレータでは禁止されています (Python 3.7 では、そのような式はコンパイル時に "
483+ ":exc:`DeprecationWarning` を発生させ、 Python 3.8 以降では :exc:`SyntaxError` "
484+ "を発生させます)。"
465485
466486#: ../../reference/expressions.rst:381
467487msgid ""
@@ -471,6 +491,8 @@ msgid ""
471491"asynchronous generator object, which is an asynchronous iterator (see :ref"
472492":`async-iterators`)."
473493msgstr ""
494+ "ジェネレータ式が :keyword:`!async for` 節あるいは :keyword:`await` 式を含んでいる場合、それは :dfn:`非同期ジェネレータ式` と呼ばれます。\n"
495+ "非同期ジェネレータ式は、非同期イテレータである新しい非同期ジェネレータオブジェクトを返します (:ref:`async-iterators` を参照してください)。"
474496
475497#: ../../reference/expressions.rst:387
476498msgid "Asynchronous generator expressions were introduced."
@@ -482,6 +504,8 @@ msgid ""
482504" :keyword:`async def` coroutines. Starting with 3.7, any function can use "
483505"asynchronous generator expressions."
484506msgstr ""
507+ "Python 3.7 より前では、非同期ジェネレータ式は :keyword:`async def` コルーチンでしか使えませんでした。\n"
508+ "3.7 からは、任意の関数で非同期ジェネレータ式が使えるようになりました。"
485509
486510#: ../../reference/expressions.rst:402
487511msgid "Yield expressions"
0 commit comments