@@ -482,6 +482,9 @@ msgid ""
482
482
":meth:`~Counter.update` and :meth:`~Counter.subtract` which allow negative "
483
483
"and zero values for both inputs and outputs."
484
484
msgstr ""
485
+ "``c[key] += 1`` のようなインプレース演算では、値の型に必要なのは 足し算と引き算ができることだけです。よって分数、浮動小数点数、 "
486
+ "小数も使え、負の値がサポートされています。これと同じことが、 負や 0 の値を入力と出力に許す :meth:`~Counter.update` と "
487
+ ":meth:`~Counter.subtract` メソッド にも言えます。"
485
488
486
489
#: ../../library/collections.rst:384
487
490
msgid ""
@@ -746,6 +749,9 @@ msgid ""
746
749
":meth:`~deque.popleft`; otherwise, it can be cycled back to the end with the"
747
750
" :meth:`~deque.rotate` method::"
748
751
msgstr ""
752
+ "`ラウンドロビンスケジューラ <https://en.wikipedia.org/wiki/Round-robin_scheduling>`_ は、入力されたイテレータを :class:`deque` に格納することで実装できます。\n"
753
+ "値は、位置0にある選択中のイテレータから取り出されます。\n"
754
+ "そのイテレータが値を出し切った場合は、 :meth:`~deque.popleft` で除去できます; そうでない場合は、 :meth:`~deque.rotate` メソッドで末尾に回せます::"
749
755
750
756
#: ../../library/collections.rst:659
751
757
msgid ""
@@ -997,6 +1003,9 @@ msgid ""
997
1003
"``x`` will be a required argument, ``y`` will default to ``1``, and ``z`` "
998
1004
"will default to ``2``."
999
1005
msgstr ""
1006
+ "*defaults* には ``None`` あるいはデフォルト値の :term:`iterable` が指定できます。\n"
1007
+ "デフォルト値を持つフィールドはデフォルト値を持たないフィールドより後ろに来なければならないので、 *defaults* は最も右にある変数に適用されます。\n"
1008
+ "例えば、 field_names が ``['x', 'y', 'z']`` で defaults が ``(1, 2)`` の場合、 ``x`` は必須の引数、 ``y`` は ``1`` がデフォルト、 ``z`` は ``2`` がデフォルトとなります。"
1000
1009
1001
1010
#: ../../library/collections.rst:834
1002
1011
msgid ""
@@ -1059,7 +1068,7 @@ msgstr "既存の sequence や Iterable から新しいインスタンスを作
1059
1068
msgid ""
1060
1069
"Return a new :class:`dict` which maps field names to their corresponding "
1061
1070
"values:"
1062
- msgstr "フィールド名を対応する値にマッピングする新しい:class:`dict` を返します::"
1071
+ msgstr "フィールド名を対応する値にマッピングする新しい :class:`dict` を返します::"
1063
1072
1064
1073
#: ../../library/collections.rst:914
1065
1074
msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`."
@@ -1179,23 +1188,29 @@ msgid ""
1179
1188
"remember insertion order (this new behavior became guaranteed in Python "
1180
1189
"3.7)."
1181
1190
msgstr ""
1191
+ "順序付き辞書は普通の辞書のようですが、順序操作に関係する追加の機能があります。\n"
1192
+ "組み込みの :class:`dict` クラスが挿入順序を記憶しておく機能 (この新しい振る舞いは Python 3.7 で保証されるようになりました) を獲得した今となっては、順序付き辞書の重要性は薄れました。"
1182
1193
1183
1194
#: ../../library/collections.rst:1041
1184
1195
msgid "Some differences from :class:`dict` still remain:"
1185
- msgstr ""
1196
+ msgstr "いまだ残っている :class:`dict` との差分: "
1186
1197
1187
1198
#: ../../library/collections.rst:1043
1188
1199
msgid ""
1189
1200
"The regular :class:`dict` was designed to be very good at mapping "
1190
1201
"operations. Tracking insertion order was secondary."
1191
1202
msgstr ""
1203
+ "通常の :class:`dict` は対応付けに向いているように設計されました。\n"
1204
+ "挿入順序の追跡は二の次です。"
1192
1205
1193
1206
#: ../../library/collections.rst:1046
1194
1207
msgid ""
1195
1208
"The :class:`OrderedDict` was designed to be good at reordering operations. "
1196
1209
"Space efficiency, iteration speed, and the performance of update operations "
1197
1210
"were secondary."
1198
1211
msgstr ""
1212
+ ":class:`OrderedDict` は並べ替え操作に向いているように設計されました。\n"
1213
+ "空間効率、反復処理の速度、更新操作のパフォーマンスは二の次です。"
1199
1214
1200
1215
#: ../../library/collections.rst:1050
1201
1216
msgid ""
@@ -1205,33 +1220,38 @@ msgid ""
1205
1220
"<https://medium.com/@krishankantsinghal/my-first-blog-on-"
1206
1221
"medium-583159139237>`_)."
1207
1222
msgstr ""
1223
+ "アルゴリズム的に、 :class:`OrderedDict` は高頻度の並べ替え操作を :class:`dict` よりも上手く扱えます。\n"
1224
+ "この性質により、 :class:`OrderedDict` は直近のアクセスの追跡 (例えば、 `LRU キャッシュ <https://medium.com/@krishankantsinghal/my-first-blog-on-medium-583159139237>`_) に向いています。"
1208
1225
1209
1226
#: ../../library/collections.rst:1055
1210
1227
msgid ""
1211
1228
"The equality operation for :class:`OrderedDict` checks for matching order."
1212
- msgstr ""
1229
+ msgstr ":class:`OrderedDict` に対する等価演算は突き合わせ順序もチェックします。 "
1213
1230
1214
1231
#: ../../library/collections.rst:1057
1215
1232
msgid ""
1216
1233
"The :meth:`popitem` method of :class:`OrderedDict` has a different "
1217
1234
"signature. It accepts an optional argument to specify which item is popped."
1218
1235
msgstr ""
1236
+ ":class:`OrderedDict` の :meth:`popitem` メソッドはシグネチャが異なります。\n"
1237
+ "どの要素を取り出すかを指定するオプション引数を受け付けます。"
1219
1238
1220
1239
#: ../../library/collections.rst:1060
1221
1240
msgid ""
1222
1241
":class:`OrderedDict` has a :meth:`move_to_end` method to efficiently "
1223
1242
"reposition an element to an endpoint."
1224
1243
msgstr ""
1244
+ ":class:`OrderedDict` には、 効率的に要素を末尾に置き直す :meth:`move_to_end` メソッドがあります。"
1225
1245
1226
1246
#: ../../library/collections.rst:1063
1227
1247
msgid "Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method."
1228
- msgstr ""
1248
+ msgstr "Python 3.8 以前は、 :class:`dict` には :meth:`__reversed__` メソッドが欠けています。 "
1229
1249
1230
1250
#: ../../library/collections.rst:1068
1231
1251
msgid ""
1232
1252
"Return an instance of a :class:`dict` subclass that has methods specialized "
1233
1253
"for rearranging dictionary order."
1234
- msgstr ""
1254
+ msgstr "辞書の順序を並べ直すためのメソッドを持つ :class:`dict` のサブクラスのインスタンスを返します。 "
1235
1255
1236
1256
#: ../../library/collections.rst:1075
1237
1257
msgid ""
@@ -1241,8 +1261,8 @@ msgid ""
1241
1261
" false."
1242
1262
msgstr ""
1243
1263
"順序付き辞書の :meth:`popitem` メソッドは、(key, value) 対を返して消去します。この対は *last* が真なら "
1244
- ":abbr:`LIFO(last-in, first-out 後入先出)` で、偽なら :abbr:`FIFO` (first-in, first-"
1245
- "out 先入先出)` で返されます。"
1264
+ ":abbr:`LIFO (last-in, first-out, 後入先出)` で、偽なら :abbr:`FIFO (first-in, first-"
1265
+ "out, 先入先出)` で返されます。"
1246
1266
1247
1267
#: ../../library/collections.rst:1082
1248
1268
msgid ""
@@ -1301,12 +1321,15 @@ msgid ""
1301
1321
"existing entry, the original insertion position is changed and moved to the "
1302
1322
"end::"
1303
1323
msgstr ""
1324
+ "キーが *最後に* 追加されたときの順序を記憶する、順序付き辞書の変種を作るのは簡単です。\n"
1325
+ "新しい値が既存の値を上書きする場合、元々の挿入位置が最後尾へ変更されます::"
1304
1326
1305
1327
#: ../../library/collections.rst:1131
1306
1328
msgid ""
1307
1329
"An :class:`OrderedDict` would also be useful for implementing variants of "
1308
1330
":func:`functools.lru_cache`::"
1309
1331
msgstr ""
1332
+ ":class:`OrderedDict` は :func:`functools.lru_cache` の変種を実装するのにも役に立ちます::"
1310
1333
1311
1334
#: ../../library/collections.rst:1154
1312
1335
msgid ":class:`UserDict` objects"
@@ -1436,18 +1459,22 @@ msgid ""
1436
1459
"to a copy of *seq*. The *seq* argument can be any object which can be "
1437
1460
"converted into a string using the built-in :func:`str` function."
1438
1461
msgstr ""
1462
+ "文字列オブジェクトをシミュレートするクラスです。\n"
1463
+ "インスタンスの内容は通常の文字列に保存され、 :class:`UserString` インスタンスの :attr:`data` 属性を通してアクセスできます。\n"
1464
+ "インスタンスの内容には最初に *seq* のコピーが設定されます。\n"
1465
+ "*seq* 引数は、組み込みの :func:`str` 関数で文字列に変換できる任意のオブジェクトです。"
1439
1466
1440
1467
#: ../../library/collections.rst:1238
1441
1468
msgid ""
1442
1469
"In addition to supporting the methods and operations of strings, "
1443
1470
":class:`UserString` instances provide the following attribute:"
1444
- msgstr ""
1471
+ msgstr "文字列のメソッドと演算をサポートするのに加え、 :class:`UserString` インスタンスは次の属性を提供します: "
1445
1472
1446
1473
#: ../../library/collections.rst:1243
1447
1474
msgid ""
1448
1475
"A real :class:`str` object used to store the contents of the "
1449
1476
":class:`UserString` class."
1450
- msgstr ""
1477
+ msgstr ":class:`UserString` クラスの内容を保存するために使われる実際の :class:`str` オブジェクトです。 "
1451
1478
1452
1479
#: ../../library/collections.rst:1246
1453
1480
msgid ""
0 commit comments