@@ -520,6 +520,9 @@ msgid ""
520
520
":keyword:`async def` function's body causes that coroutine function to be an"
521
521
" asynchronous generator. For example::"
522
522
msgstr ""
523
+ "yield 式は :term:`ジェネレータ <generator>` 関数や term:`非同期ジェネレータ <asynchronous generator>` を定義するときに使われます。従って、関数定義の本体でのみ使えます。\n"
524
+ "関数の本体で yield 式 を使用するとその関数はジェネレータになり、 :keyword:`async def` 関数の本体で使用するとそのコルーチン関数は非同期ジェネレータになります。\n"
525
+ "例えば次のようになります::"
523
526
524
527
#: ../../reference/expressions.rst:427
525
528
msgid ""
@@ -529,19 +532,25 @@ msgid ""
529
532
"emit :exc:`DeprecationWarning` when compiled, in Python 3.8+ they will emit "
530
533
":exc:`SyntaxError`).."
531
534
msgstr ""
535
+ "含まれているスコープの副作用のため、 ``yield`` "
536
+ "式は暗黙的に定義されたスコープの一部として内包表記やジェネレータ式を実装するのに使うことは許可されていません (Python 3.7 "
537
+ "では、そのような式はコンパイル時に :exc:`DeprecationWarning` を発生させ、 Python 3.8 以降では "
538
+ ":exc:`SyntaxError` を発生させます)。 "
532
539
533
540
#: ../../reference/expressions.rst:433
534
541
msgid ""
535
542
"Yield expressions deprecated in the implicitly nested scopes used to "
536
543
"implement comprehensions and generator expressions."
537
- msgstr ""
544
+ msgstr "yield 式は、暗黙的な入れ子のスコープで内包表記やジェネレータ式を実装するための使用が非推奨になりました。 "
538
545
539
546
#: ../../reference/expressions.rst:437
540
547
msgid ""
541
548
"Generator functions are described below, while asynchronous generator "
542
549
"functions are described separately in section :ref:`asynchronous-generator-"
543
550
"functions`."
544
551
msgstr ""
552
+ "ジェネレータ関数についてはすぐ下で説明されています。非同期ジェネレータ関数は、 :ref:`asynchronous-generator-"
553
+ "functions` 節に分けて説明されています。"
545
554
546
555
#: ../../reference/expressions.rst:441
547
556
msgid ""
@@ -652,7 +661,7 @@ msgstr ":pep:`0342` - 拡張されたジェネレータを用いたコルーチ
652
661
msgid ""
653
662
"The proposal to enhance the API and syntax of generators, making them usable"
654
663
" as simple coroutines."
655
- msgstr "シンプルなコルーチンとして利用できるように、ジェネレータの構文と API を拡張する提案です 。"
664
+ msgstr "シンプルなコルーチンとして利用できるように、ジェネレータの構文と API を拡張する提案 。"
656
665
657
666
#: ../../reference/expressions.rst:507
658
667
msgid ":pep:`380` - Syntax for Delegating to a Subgenerator"
@@ -672,7 +681,7 @@ msgstr ":pep:`525` - 非同期ジェネレータ"
672
681
msgid ""
673
682
"The proposal that expanded on :pep:`492` by adding generator capabilities to"
674
683
" coroutine functions."
675
- msgstr ""
684
+ msgstr "コルーチン関数へのジェネレータの実装能力の追加による :pep:`492` の拡張提案。 "
676
685
677
686
#: ../../reference/expressions.rst:517
678
687
msgid "Generator-iterator methods"
@@ -753,6 +762,10 @@ msgid ""
753
762
" it is propagated to the caller. :meth:`close` does nothing if the "
754
763
"generator has already exited due to an exception or normal exit."
755
764
msgstr ""
765
+ "ジェネレータ関数が一時停止した時点で :exc:`GeneratorExit` を発生させます。\n"
766
+ "そして、ジェネレータ関数が無事に終了するか、既にクローズされているか、(例外が捕捉されなかったために) :exc:`GeneratorExit` が送出された場合、 close は呼び出し元へ戻ります。\n"
767
+ "ジェネレータが値を生成する場合 :exc:`RuntimeError` が発生します。\n"
768
+ ":meth:`close` はジェネレータが例外や正常な終了により既に終了している場合は何もしません。"
756
769
757
770
#: ../../reference/expressions.rst:578
758
771
msgid "Examples"
@@ -781,6 +794,8 @@ msgid ""
781
794
":keyword:`async def` further defines the function as a :term:`asynchronous "
782
795
"generator` function."
783
796
msgstr ""
797
+ ":keyword:`async def` を使用して定義された関数やメソッドに yield 式があると、その関数は :term:`非同期ジェネレータ "
798
+ "<asynchronous generator>` 関数として定義されます。"
784
799
785
800
#: ../../reference/expressions.rst:619
786
801
msgid ""
@@ -987,7 +1002,7 @@ msgstr ""
987
1002
msgid ""
988
1003
"If the primary is a sequence, the expression list must evaluate to an "
989
1004
"integer or a slice (as discussed in the following section)."
990
- msgstr ""
1005
+ msgstr "プライマリがシーケンスであれば、式リストの評価結果は整数またはスライス (以下の節で論じます) でなければなりません。 "
991
1006
992
1007
#: ../../reference/expressions.rst:819
993
1008
msgid ""
0 commit comments