@@ -260,7 +260,7 @@ msgid ""
260
260
" This ensures that names assigned to in the target list don't \" leak\" into "
261
261
"the enclosing scope."
262
262
msgstr ""
263
- "なお 、最も左にある :keyword:`!for` 節のイテラブル式を除いて、内包表記は暗黙的にネストされた個別のスコープで実行されます。\n"
263
+ "ただし 、最も左にある :keyword:`!for` 節のイテラブル式を除いて、内包表記は暗黙的にネストされた個別のスコープで実行されます。\n"
264
264
"この仕組みのおかげで、対象のリスト内で代入された名前が外側のスコープに \" 漏れる\" ことはありません。"
265
265
266
266
#: ../../reference/expressions.rst:198
@@ -272,6 +272,9 @@ msgid ""
272
272
"enclosing scope as they may depend on the values obtained from the leftmost "
273
273
"iterable. For example: ``[x*y for x in range(10) for y in range(x, x+10)]``."
274
274
msgstr ""
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)]`` 。"
275
278
276
279
#: ../../reference/expressions.rst:205
277
280
msgid ""
@@ -281,6 +284,10 @@ msgid ""
281
284
":exc:`DeprecationWarning` when compiled, in Python 3.8+ they will emit "
282
285
":exc:`SyntaxError`)."
283
286
msgstr ""
287
+ "内包表記が常に適切な型のコンテナになるのを保証するために、 ``yield`` 式や ``yield from`` "
288
+ "式は暗黙的な入れ子のスコープでは禁止されています (Python 3.7 では、そのような式はコンパイル時に "
289
+ ":exc:`DeprecationWarning` を発生させ、 Python 3.8 以降では :exc:`SyntaxError` "
290
+ "を発生させます)。"
284
291
285
292
#: ../../reference/expressions.rst:213
286
293
msgid ""
@@ -295,6 +302,11 @@ msgid ""
295
302
"asynchronous comprehension may suspend the execution of the coroutine "
296
303
"function in which it appears. See also :pep:`530`."
297
304
msgstr ""
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` も参照してください。"
298
310
299
311
#: ../../reference/expressions.rst:225
300
312
msgid "Asynchronous comprehensions were introduced."
@@ -303,7 +315,7 @@ msgstr "非同期内包表記が導入されました。"
303
315
#: ../../reference/expressions.rst:228 ../../reference/expressions.rst:395
304
316
msgid ""
305
317
"``yield`` and ``yield from`` deprecated in the implicitly nested scope."
306
- msgstr ""
318
+ msgstr "``yield`` および ``yield from`` は暗黙的な入れ子のスコープでは非推奨となりました。 "
307
319
308
320
#: ../../reference/expressions.rst:235
309
321
msgid "List displays"
@@ -395,7 +407,7 @@ msgstr ""
395
407
396
408
#: ../../reference/expressions.rst:324
397
409
msgid "Unpacking into dictionary displays, originally proposed by :pep:`448`."
398
- msgstr ""
410
+ msgstr "辞書表示のアンパッキングは最初に :pep:`448` で提案されました。 "
399
411
400
412
#: ../../reference/expressions.rst:327
401
413
msgid ""
@@ -447,6 +459,10 @@ msgid ""
447
459
"scope as they may depend on the values obtained from the leftmost iterable. "
448
460
"For example: ``(x*y for x in range(10) for y in range(x, x+10))``."
449
461
msgstr ""
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))`` 。"
450
466
451
467
#: ../../reference/expressions.rst:372
452
468
msgid ""
@@ -462,6 +478,10 @@ msgid ""
462
478
":exc:`DeprecationWarning` when compiled, in Python 3.8+ they will emit "
463
479
":exc:`SyntaxError`)."
464
480
msgstr ""
481
+ "ジェネレータ式自身の期待される動作を妨げないために、 ``yield`` 式や ``yield from`` "
482
+ "式は暗黙的に定義されたジェネレータでは禁止されています (Python 3.7 では、そのような式はコンパイル時に "
483
+ ":exc:`DeprecationWarning` を発生させ、 Python 3.8 以降では :exc:`SyntaxError` "
484
+ "を発生させます)。"
465
485
466
486
#: ../../reference/expressions.rst:381
467
487
msgid ""
@@ -471,6 +491,8 @@ msgid ""
471
491
"asynchronous generator object, which is an asynchronous iterator (see :ref"
472
492
":`async-iterators`)."
473
493
msgstr ""
494
+ "ジェネレータ式が :keyword:`!async for` 節あるいは :keyword:`await` 式を含んでいる場合、それは :dfn:`非同期ジェネレータ式` と呼ばれます。\n"
495
+ "非同期ジェネレータ式は、非同期イテレータである新しい非同期ジェネレータオブジェクトを返します (:ref:`async-iterators` を参照してください)。"
474
496
475
497
#: ../../reference/expressions.rst:387
476
498
msgid "Asynchronous generator expressions were introduced."
@@ -482,6 +504,8 @@ msgid ""
482
504
" :keyword:`async def` coroutines. Starting with 3.7, any function can use "
483
505
"asynchronous generator expressions."
484
506
msgstr ""
507
+ "Python 3.7 より前では、非同期ジェネレータ式は :keyword:`async def` コルーチンでしか使えませんでした。\n"
508
+ "3.7 からは、任意の関数で非同期ジェネレータ式が使えるようになりました。"
485
509
486
510
#: ../../reference/expressions.rst:402
487
511
msgid "Yield expressions"
0 commit comments