@@ -3414,50 +3414,70 @@ msgid ""
3414
3414
"the code that prepared these iterables. Python offers three different "
3415
3415
"approaches to dealing with this issue:"
3416
3416
msgstr ""
3417
+ "ここで考慮すべきことは、 :func:`zip` に渡されるイテラブルが異なる長さを持つこ"
3418
+ "とがあるという点です; ときには意図的な場合もあり、またときにはイテラブルを準"
3419
+ "備するコードにおけるバグのこともあるでしょう。 Python はこの問題に対して3つの"
3420
+ "異なるアプローチを提供します:"
3417
3421
3418
3422
#: ../../library/functions.rst:1883
3419
3423
msgid ""
3420
3424
"By default, :func:`zip` stops when the shortest iterable is exhausted. It "
3421
3425
"will ignore the remaining items in the longer iterables, cutting off the "
3422
3426
"result to the length of the shortest iterable::"
3423
3427
msgstr ""
3428
+ "デフォルトでは、 :func:`zip` は最も短いイテラブルが消費しきった時点で停止しま"
3429
+ "す。より繰り返し数の長いイテラブルの残りの要素は無視して、結果を最も短いイテ"
3430
+ "ラブルの長さに切り詰めます::"
3424
3431
3425
3432
#: ../../library/functions.rst:1890
3426
3433
msgid ""
3427
3434
":func:`zip` is often used in cases where the iterables are assumed to be of "
3428
3435
"equal length. In such cases, it's recommended to use the ``strict=True`` "
3429
3436
"option. Its output is the same as regular :func:`zip`::"
3430
3437
msgstr ""
3438
+ ":func:`zip` は、しばしば受け取ったイテラブルが全て同じ長さであるという想定の"
3439
+ "下で使われます。そのような場合、 ``strict=True`` オプションの利用が推奨されま"
3440
+ "す。その出力は通常の :func:`zip` と同じです::"
3431
3441
3432
3442
#: ../../library/functions.rst:1897
3433
3443
msgid ""
3434
3444
"Unlike the default behavior, it raises a :exc:`ValueError` if one iterable "
3435
3445
"is exhausted before the others:"
3436
3446
msgstr ""
3447
+ "しかし、デフォルトの動作と異なり、あるイテラブルが他のイテラブルよりも先に消"
3448
+ "費しきった場合に :exc:`ValueError`例外を送出します:"
3437
3449
3438
3450
#: ../../library/functions.rst:1915
3439
3451
msgid ""
3440
3452
"Without the ``strict=True`` argument, any bug that results in iterables of "
3441
3453
"different lengths will be silenced, possibly manifesting as a hard-to-find "
3442
3454
"bug in another part of the program."
3443
3455
msgstr ""
3456
+ "``strict=True`` 引数なしの場合、長さの異なるイテラブルを生じる原因となるいか"
3457
+ "なるバグも、この時点では問題なく処理されます。そして代わりにプログラムの別の"
3458
+ "場所で、原因を特定しにくいバグとして検出されることになるでしょう。"
3444
3459
3445
3460
#: ../../library/functions.rst:1919
3446
3461
msgid ""
3447
3462
"Shorter iterables can be padded with a constant value to make all the "
3448
3463
"iterables have the same length. This is done by :func:`itertools."
3449
3464
"zip_longest`."
3450
3465
msgstr ""
3466
+ "短いイテラブルを一定の値でパディングして全てのイテラブルが同じ長さになるよう"
3467
+ "にすることもできます。この機能は :func:`itertools.zip_longest` で提供されま"
3468
+ "す。"
3451
3469
3452
3470
#: ../../library/functions.rst:1923
3453
3471
msgid ""
3454
3472
"Edge cases: With a single iterable argument, :func:`zip` returns an iterator "
3455
3473
"of 1-tuples. With no arguments, it returns an empty iterator."
3456
3474
msgstr ""
3475
+ "エッジケース: 引数としてイテラブルをひとつだけ渡した場合、 :func:`zip` は 1 "
3476
+ "タプルのイテレータを返します。引数なしの場合は空のイテレータを返します。"
3457
3477
3458
3478
#: ../../library/functions.rst:1926
3459
3479
msgid "Tips and tricks:"
3460
- msgstr ""
3480
+ msgstr "ヒントとコツ: "
3461
3481
3462
3482
#: ../../library/functions.rst:1928
3463
3483
msgid ""
0 commit comments