@@ -105,7 +105,7 @@ msgstr "以下の節における文法規則の記述方式は、明確さのた
105
105
106
106
#: ../../reference/compound_stmts.rst:82
107
107
msgid "The :keyword:`!if` statement"
108
- msgstr ""
108
+ msgstr ":keyword:`!if` 文 "
109
109
110
110
#: ../../reference/compound_stmts.rst:90
111
111
msgid "The :keyword:`if` statement is used for conditional execution:"
@@ -127,7 +127,7 @@ msgstr ""
127
127
128
128
#: ../../reference/compound_stmts.rst:107
129
129
msgid "The :keyword:`!while` statement"
130
- msgstr ""
130
+ msgstr ":keyword:`!while` 文 "
131
131
132
132
#: ../../reference/compound_stmts.rst:115
133
133
msgid ""
@@ -142,6 +142,8 @@ msgid ""
142
142
" the suite of the :keyword:`!else` clause, if present, is executed and the "
143
143
"loop terminates."
144
144
msgstr ""
145
+ ":keyword:`while` 文は式を繰り返し真偽評価し、真であれば最初のスイートを実行します。式が偽であれば "
146
+ "(最初から偽になっていることもありえます)、 :keyword:`!else` 節がある場合にはそれを実行し、ループを終了します。"
145
147
146
148
#: ../../reference/compound_stmts.rst:131
147
149
msgid ""
@@ -150,10 +152,13 @@ msgid ""
150
152
":keyword:`continue` statement executed in the first suite skips the rest of "
151
153
"the suite and goes back to testing the expression."
152
154
msgstr ""
155
+ "最初のスイート内で :keyword:`break` 文が実行されると、 :keyword:`!else` "
156
+ "節のスイートを実行することなくループを終了します。 :keyword:`continue` "
157
+ "文が最初のスイート内で実行されると、スイート内にある残りの文の実行をスキップして、式の真偽評価に戻ります。"
153
158
154
159
#: ../../reference/compound_stmts.rst:140
155
160
msgid "The :keyword:`!for` statement"
156
- msgstr ""
161
+ msgstr ":keyword:`!for` 文 "
157
162
158
163
#: ../../reference/compound_stmts.rst:151
159
164
msgid ""
@@ -175,6 +180,11 @@ msgid ""
175
180
"exception), the suite in the :keyword:`!else` clause, if present, is "
176
181
"executed, and the loop terminates."
177
182
msgstr ""
183
+ "式リストは一度だけ評価されます。その結果はイテラブルオブジェクトにならなければなりません。\n"
184
+ "``expression_list`` の結果対するイテレータが生成されます。\n"
185
+ "その後、イテレータが与えるそれぞれの要素に対して、イテレータから返された順に一度づつ、スイートが実行されます。\n"
186
+ "それぞれの要素は標準の代入規則 (:ref:`assignment` を参照してください) で target_list に代入され、その後、スイートが実行されます。\n"
187
+ "全ての要素を使い切ったとき (シーケンスが空であったり、イテレータが :exc:`StopIteration` 例外を送出したときは、即座に)、 :keyword:`!else` 節があればそれが実行され、ループは終了します。"
178
188
179
189
#: ../../reference/compound_stmts.rst:171
180
190
msgid ""
@@ -184,6 +194,8 @@ msgid ""
184
194
"the suite and continues with the next item, or with the :keyword:`!else` "
185
195
"clause if there is no next item."
186
196
msgstr ""
197
+ "最初のスイートの中で :keyword:`break` 文が実行されると、 :keyword:`!else` 節のスイートを実行することなくループを終了します。\n"
198
+ ":keyword:`continue` 文が最初のスイート内で実行されると、スイート内にある残りの文の実行をスキップして、次の要素の処理に移るか、これ以上次の要素が無い場合は :keyword:`!else` 節の処理に移ります。"
187
199
188
200
#: ../../reference/compound_stmts.rst:177
189
201
msgid ""
@@ -221,10 +233,18 @@ msgid ""
221
233
" This can lead to nasty bugs that can be avoided by making a temporary copy "
222
234
"using a slice of the whole sequence, e.g., ::"
223
235
msgstr ""
236
+ "ループ中でのシーケンスの変更には微妙な問題があります (これはミュータブルなシーケンスのみ、例えばリストで起こり得ます)。\n"
237
+ "どの要素が次に使われるかを追跡するために、内部的なカウンタが使われており、このカウンタは反復のたびに加算されます。\n"
238
+ "このカウンタがシーケンスの長さに達すると、ループは終了します。\n"
239
+ "このことから、スイートの中でシーケンスから現在の (または以前の) 要素を除去すると、(次の要素の位置が、既に処理済みの現在の要素のインデックスになるために) 次の要素が飛ばされることになります。\n"
240
+ "同様に、スイートの中でシーケンス中の現在の要素以前に要素を挿入すると、現在の要素がループの次の週で再度扱われることになります。\n"
241
+ "こうした仕様は、厄介なバグにつながります。\n"
242
+ "これは、シーケンス全体のスライスを使って一時的なコピーを作ることで避けられます。\n"
243
+ "例えば次のようにします::"
224
244
225
245
#: ../../reference/compound_stmts.rst:224
226
246
msgid "The :keyword:`!try` statement"
227
- msgstr ""
247
+ msgstr ":keyword:`!try` 文 "
228
248
229
249
#: ../../reference/compound_stmts.rst:234
230
250
msgid ""
@@ -246,6 +266,13 @@ msgid ""
246
266
"exception if it is the class or a base class of the exception object or a "
247
267
"tuple containing an item compatible with the exception."
248
268
msgstr ""
269
+ ":keyword:`except` 節は一つ以上の例外ハンドラを指定します。 :keyword:`try` "
270
+ "節内で例外が起きなければ、どの例外ハンドラも実行されません。 :keyword:`!try` "
271
+ "スイート内で例外が発生すると、例外ハンドラの検索が開始されます。この検索では、 :keyword:`except` "
272
+ "節を逐次、発生した例外に対応するまで調べます。式を伴わない :keyword:`except` "
273
+ "節を使うなら、最後に書かなければならず、これは全ての例外に対応します。式を伴う :keyword:`except` "
274
+ "節に対しては、その式が評価され、結果のオブジェクトが例外と \" 互換である (compatible)\" "
275
+ "場合にその節が対応します。ある例外に対してオブジェクトが互換であるのは、それが例外オブジェクトのクラスかベースクラスの場合、または例外と互換である要素が入ったタプルである場合です。"
249
276
250
277
#: ../../reference/compound_stmts.rst:258
251
278
msgid ""
0 commit comments