@@ -105,7 +105,7 @@ msgstr "以下の節における文法規則の記述方式は、明確さのた
105105
106106#: ../../reference/compound_stmts.rst:82
107107msgid "The :keyword:`!if` statement"
108- msgstr ""
108+ msgstr ":keyword:`!if` 文 "
109109
110110#: ../../reference/compound_stmts.rst:90
111111msgid "The :keyword:`if` statement is used for conditional execution:"
@@ -127,7 +127,7 @@ msgstr ""
127127
128128#: ../../reference/compound_stmts.rst:107
129129msgid "The :keyword:`!while` statement"
130- msgstr ""
130+ msgstr ":keyword:`!while` 文 "
131131
132132#: ../../reference/compound_stmts.rst:115
133133msgid ""
@@ -142,6 +142,8 @@ msgid ""
142142" the suite of the :keyword:`!else` clause, if present, is executed and the "
143143"loop terminates."
144144msgstr ""
145+ ":keyword:`while` 文は式を繰り返し真偽評価し、真であれば最初のスイートを実行します。式が偽であれば "
146+ "(最初から偽になっていることもありえます)、 :keyword:`!else` 節がある場合にはそれを実行し、ループを終了します。"
145147
146148#: ../../reference/compound_stmts.rst:131
147149msgid ""
@@ -150,10 +152,13 @@ msgid ""
150152":keyword:`continue` statement executed in the first suite skips the rest of "
151153"the suite and goes back to testing the expression."
152154msgstr ""
155+ "最初のスイート内で :keyword:`break` 文が実行されると、 :keyword:`!else` "
156+ "節のスイートを実行することなくループを終了します。 :keyword:`continue` "
157+ "文が最初のスイート内で実行されると、スイート内にある残りの文の実行をスキップして、式の真偽評価に戻ります。"
153158
154159#: ../../reference/compound_stmts.rst:140
155160msgid "The :keyword:`!for` statement"
156- msgstr ""
161+ msgstr ":keyword:`!for` 文 "
157162
158163#: ../../reference/compound_stmts.rst:151
159164msgid ""
@@ -175,6 +180,11 @@ msgid ""
175180"exception), the suite in the :keyword:`!else` clause, if present, is "
176181"executed, and the loop terminates."
177182msgstr ""
183+ "式リストは一度だけ評価されます。その結果はイテラブルオブジェクトにならなければなりません。\n"
184+ "``expression_list`` の結果対するイテレータが生成されます。\n"
185+ "その後、イテレータが与えるそれぞれの要素に対して、イテレータから返された順に一度づつ、スイートが実行されます。\n"
186+ "それぞれの要素は標準の代入規則 (:ref:`assignment` を参照してください) で target_list に代入され、その後、スイートが実行されます。\n"
187+ "全ての要素を使い切ったとき (シーケンスが空であったり、イテレータが :exc:`StopIteration` 例外を送出したときは、即座に)、 :keyword:`!else` 節があればそれが実行され、ループは終了します。"
178188
179189#: ../../reference/compound_stmts.rst:171
180190msgid ""
@@ -184,6 +194,8 @@ msgid ""
184194"the suite and continues with the next item, or with the :keyword:`!else` "
185195"clause if there is no next item."
186196msgstr ""
197+ "最初のスイートの中で :keyword:`break` 文が実行されると、 :keyword:`!else` 節のスイートを実行することなくループを終了します。\n"
198+ ":keyword:`continue` 文が最初のスイート内で実行されると、スイート内にある残りの文の実行をスキップして、次の要素の処理に移るか、これ以上次の要素が無い場合は :keyword:`!else` 節の処理に移ります。"
187199
188200#: ../../reference/compound_stmts.rst:177
189201msgid ""
@@ -221,10 +233,18 @@ msgid ""
221233" This can lead to nasty bugs that can be avoided by making a temporary copy "
222234"using a slice of the whole sequence, e.g., ::"
223235msgstr ""
236+ "ループ中でのシーケンスの変更には微妙な問題があります (これはミュータブルなシーケンスのみ、例えばリストで起こり得ます)。\n"
237+ "どの要素が次に使われるかを追跡するために、内部的なカウンタが使われており、このカウンタは反復のたびに加算されます。\n"
238+ "このカウンタがシーケンスの長さに達すると、ループは終了します。\n"
239+ "このことから、スイートの中でシーケンスから現在の (または以前の) 要素を除去すると、(次の要素の位置が、既に処理済みの現在の要素のインデックスになるために) 次の要素が飛ばされることになります。\n"
240+ "同様に、スイートの中でシーケンス中の現在の要素以前に要素を挿入すると、現在の要素がループの次の週で再度扱われることになります。\n"
241+ "こうした仕様は、厄介なバグにつながります。\n"
242+ "これは、シーケンス全体のスライスを使って一時的なコピーを作ることで避けられます。\n"
243+ "例えば次のようにします::"
224244
225245#: ../../reference/compound_stmts.rst:224
226246msgid "The :keyword:`!try` statement"
227- msgstr ""
247+ msgstr ":keyword:`!try` 文 "
228248
229249#: ../../reference/compound_stmts.rst:234
230250msgid ""
@@ -246,6 +266,13 @@ msgid ""
246266"exception if it is the class or a base class of the exception object or a "
247267"tuple containing an item compatible with the exception."
248268msgstr ""
269+ ":keyword:`except` 節は一つ以上の例外ハンドラを指定します。 :keyword:`try` "
270+ "節内で例外が起きなければ、どの例外ハンドラも実行されません。 :keyword:`!try` "
271+ "スイート内で例外が発生すると、例外ハンドラの検索が開始されます。この検索では、 :keyword:`except` "
272+ "節を逐次、発生した例外に対応するまで調べます。式を伴わない :keyword:`except` "
273+ "節を使うなら、最後に書かなければならず、これは全ての例外に対応します。式を伴う :keyword:`except` "
274+ "節に対しては、その式が評価され、結果のオブジェクトが例外と \" 互換である (compatible)\" "
275+ "場合にその節が対応します。ある例外に対してオブジェクトが互換であるのは、それが例外オブジェクトのクラスかベースクラスの場合、または例外と互換である要素が入ったタプルである場合です。"
249276
250277#: ../../reference/compound_stmts.rst:258
251278msgid ""
0 commit comments