@@ -15,7 +15,7 @@ msgid ""
15
15
msgstr ""
16
16
"Project-Id-Version : Python 3.12\n "
17
17
"Report-Msgid-Bugs-To : \n "
18
- "POT-Creation-Date : 2023-09-08 14:13+0000\n "
18
+ "POT-Creation-Date : 2023-09-15 14:13+0000\n "
19
19
"PO-Revision-Date : 2021-06-28 00:52+0000\n "
20
20
"Last-Translator : Arihiro TAKASE, 2023\n "
21
21
"Language-Team : Japanese (https://app.transifex.com/python-doc/teams/5390/ "
@@ -255,6 +255,13 @@ msgid ""
255
255
"derived class method wants to extend the base class method of the same name "
256
256
"and thus has to call the base class method somehow."
257
257
msgstr ""
258
+ "第二に、特定のクラスからメソッドを明示的に参照または呼び出ししたい時に、特別"
259
+ "な構文が必要なくなります。C++ では、派生クラスでオーバーライドされた基底クラ"
260
+ "スからメソッドを使うには、 ``::`` 演算子を使わなければなりません。 -- Python "
261
+ "では、 ``baseclass.methodname(self, <argument list>)`` と書けます。これは特"
262
+ "に、 :meth:`~object.__init__` メソッドに便利ですし、派生クラスのメソッドが、"
263
+ "基底クラスにある同じ名前のメソッドを拡張するために、基底クラスのメソッドをど"
264
+ "うにかして呼び出したい時にも便利です。"
258
265
259
266
#: ../../faq/design.rst:136
260
267
msgid ""
@@ -437,6 +444,9 @@ msgid ""
437
444
"exceptions are raised. Actually catching an exception is expensive. In "
438
445
"versions of Python prior to 2.0 it was common to use this idiom::"
439
446
msgstr ""
447
+ ":keyword:`try`/:keyword:`except` ブロックは例外が送出されなければ極端に効率的"
448
+ "です。実際に例外を捕捉するのは高価です。Python 2.0 より前のバージョンでは、こ"
449
+ "のイディオムを使うのが一般的でした::"
440
450
441
451
#: ../../faq/design.rst:246
442
452
msgid ""
@@ -625,6 +635,10 @@ msgid ""
625
635
"however, those file objects will only get collected (and closed) at varying "
626
636
"and possibly long intervals."
627
637
msgstr ""
638
+ "実際、CPython の参照カウントとデストラクタのスキームを使えば ``f`` への新しい"
639
+ "代入ごとにファイルは閉じられます。しかし、伝統的な GC を使うと、これらのファ"
640
+ "イルオブジェクトが回収され (て閉じられる) までに不定な、場合によっては長い、"
641
+ "間隔が空くことがあります。"
628
642
629
643
#: ../../faq/design.rst:360
630
644
msgid ""
@@ -664,6 +678,12 @@ msgid ""
664
678
"Right now, CPython works with anything that implements ``malloc()`` and "
665
679
"``free()`` properly."
666
680
msgstr ""
681
+ "伝統的な GC は Python が他のアプリケーションに組み込まれるときにも問題となり"
682
+ "ます。スタンドアロンの Python で動く限りでは、標準の ``malloc()`` と "
683
+ "``free()`` を GC ライブラリから提供されるものに置き換えても問題ありませんが、"
684
+ "Python を実装したアプリケーションは Python のものではない *独自の* 代替品を使"
685
+ "おうとするかもしれません。現在のようにすることで、CPython は ``malloc()`` と "
686
+ "``free()`` が適切に実装されている限りどんなものにも対応させられます。"
667
687
668
688
#: ../../faq/design.rst:387
669
689
msgid "Why isn't all memory freed when CPython exits?"
@@ -707,6 +727,11 @@ msgid ""
707
727
"example, a Cartesian coordinate is appropriately represented as a tuple of "
708
728
"two or three numbers."
709
729
msgstr ""
730
+ "リストとタプルは、多くの点で似ていますが、一般には本質的に異なる方法で使われ"
731
+ "ます。タプルは、Pascal の ``レコード`` や C の ``構造体`` と同様なものと考え"
732
+ "られます。型が異なっても良い関連するデータの小さな集合で、グループとして演算"
733
+ "されます。例えば、デカルト座標は 2 つや 3 つの数のタプルとして適切に表せま"
734
+ "す。"
710
735
711
736
#: ../../faq/design.rst:410
712
737
msgid ""
@@ -717,6 +742,11 @@ msgid ""
717
742
"directory. Functions which operate on this output would generally not break "
718
743
"if you added another file or two to the directory."
719
744
msgstr ""
745
+ "一方、リストは、もっと他の言語の配列に近いものです。全て同じ型の可変数のオブ"
746
+ "ジェクトを持ち、それらが一つ一つ演算される傾向にあります。例えば、 :func:`os."
747
+ "listdir('.') <os.listdir>` はカレントディレクトリ内にあるファイルの文字列表現"
748
+ "のリストを返します。この出力を演算する関数は一般に、ディレクトリに一つや二つ"
749
+ "の別のファイルを加えても壊れません。"
720
750
721
751
#: ../../faq/design.rst:418
722
752
msgid ""
@@ -793,6 +823,14 @@ msgid ""
793
823
"values, this means that dictionaries take constant time -- O(1), in Big-O "
794
824
"notation -- to retrieve a key."
795
825
msgstr ""
826
+ "辞書は、 辞書に保存されているそれぞれのキーに対応するハッシュコードを :func:"
827
+ "`hash` ビルトイン関数で計算することで機能します。このハッシュコードはキーやプ"
828
+ "ロセスごとのシードによって大きく変化します。例えば、``'Python'`` のハッシュ値"
829
+ "は ``-539294296`` ですが、ビットが一つ違うだけの文字列 ``'python'`` のハッ"
830
+ "シュ値は ``1142331976`` です。そしてこのハッシュコードは、値が保存される内部"
831
+ "配
8000
での位置を計算するために使われます。保存しているキーのハッシュ値が全て異"
832
+ "なるとすれば、一定の時間 − big O-記法ではO(1) − でキーを検索できることになり"
833
+ "ます。"
796
834
797
835
#: ../../faq/design.rst:458
798
836
msgid "Why must dictionary keys be immutable?"
@@ -899,6 +937,12 @@ msgid ""
899
937
"reside in a dictionary (or other hash based structure), remain fixed while "
900
938
"the object is in the dictionary (or other structure). ::"
901
939
msgstr ""
940
+ "必要ならばこれを回避する方法がありますが、自己責任のもとで行ってください。"
941
+ "ミュータブルな構造を、 :meth:`~object.__eq__` と :meth:`~object.__hash__` メ"
942
+ "ソッドの両方を持つクラスインスタンスに含めることができます。その時、辞書 (ま"
943
+ "たはハッシュに基づく別の構造体) に属するような全てのラッパーオブジェクトの"
944
+ "ハッシュ値が、そのオブジェクトが辞書 (その他の構造体) 中にある間固定され続け"
945
+ "ることを確実にしてください。 ::"
902
946
903
947
#: ../../faq/design.rst:525
904
948
msgid ""
@@ -929,6 +973,10 @@ msgid ""
929
973
"this unless you are prepared to think hard about the requirements and the "
930
974
"consequences of not meeting them correctly. Consider yourself warned."
931
975
msgstr ""
976
+ "この :class:`!ListWrapper` の例では、異常を避けるため、ラッパオブジェクトが辞"
977
+ "書内にある限りラップされたリストが変更されてはなりません。この条件と満たせな"
978
+ "かった時の結果について知恵を絞る覚悟がない限り、これをしてはいけません。よく"
979
+ "考えてください。"
932
980
933
981
#: ../../faq/design.rst:541
934
982
msgid "Why doesn't list.sort() return the sorted list?"
@@ -1029,6 +1077,12 @@ msgid ""
1029
1077
"actually do this correctly, but it's trivial to check this property in a "
1030
1078
"test suite."
1031
1079
msgstr ""
1080
+ "Python で大きくて複雑なアプリケーションを構築するとき、インターフェース仕様と"
1081
+ "同様に、適切なテスト規律も役立ちます。実際には、インターフェース仕様ではテス"
1082
+ "トできないプログラムの属性もあるので、それ以上にもなりえます。例えば、 :meth:"
1083
+ "`!list.append` メソッドは新しい要素をある内部リストの終わりに加えます。イン"
1084
+ "ターフェース仕様ではこの :meth:`!list.append` の実装が実際にこれを行うかをテ"
1085
+ "ストできませんが、テストスイートならこの機能を簡単に確かめられます。"
1032
1086
1033
1087
#: ../../faq/design.rst:592
1034
1088
msgid ""
@@ -1058,6 +1112,13 @@ msgid ""
1058
1112
"`while` and :keyword:`for` statements, possibly containing :keyword:"
1059
1113
"`continue` and :keyword:`break`)."
1060
1114
msgstr ""
1115
+ "1970年代、人々は気付きました。秩序なき goto は、理解するのも手直しするのも困"
1116
+ "難という厄介な\" スパゲッティ\" コードに陥りがちであると。\n"
1117
+ "高水準言語では、分岐とループの手段があれば goto は不要です。\n"
1118
+ "(Pythonだと、分岐には :keyword:`if` 文及び :keyword:`or` ・ :keyword:`and` "
1119
+ "・ :keyword:`if`/:keyword:`else` 式を使います。ループには :keyword:`while` 文"
1120
+ "と :keyword:`for` 文を使い、 ループ内に :keyword:`continue` ・ :keyword:"
1121
+ "`break` を含むことがあります)"
1061
1122
1062
1123
#: ../../faq/design.rst:609
1063
1124
msgid ""
@@ -1066,12 +1127,18 @@ msgid ""
1066
1127
"all reasonable uses of the ``go`` or ``goto`` constructs of C, Fortran, and "
1067
1128
"other languages. For example::"
1068
1129
msgstr ""
1130
+ "関数の呼び出しをまたいでも動作する \" 構造化された goto\" をまかなうものとして"
1131
+ "例外を使えます。C、Fortran、その他の言語での ``go`` あるいは ``goto`` 構造の"
1132
+ "適切な用途は全て、例外で同じようなことをすれば便利であると、広く感じられてい"
1133
+ "ます。例えば::"
1069
1134
1070
1135
#: ../../faq/design.rst:625
1071
1136
msgid ""
1072
1137
"This doesn't allow you to jump into the middle of a loop, but that's usually "
1073
1138
"considered an abuse of ``goto`` anyway. Use sparingly."
1074
1139
msgstr ""
1140
+ "例外ではループ内へ跳ぶことはできませんが、どちらにしてもそれは ``goto`` の乱"
1141
+ "用と見なされるものです。使うのは控えてください。"
1075
1142
1076
1143
#: ../../faq/design.rst:630
1077
1144
msgid "Why can't raw strings (r-strings) end with a backslash?"
@@ -1129,6 +1196,9 @@ msgid ""
1129
1196
"calling code on the entrance and exit from the block. Some languages have a "
1130
1197
"construct that looks like this::"
1131
1198
msgstr ""
1199
+ "Python には、ブロックの実行を包む :keyword:`with` 文があり、ブロックに入ると"
1200
+ "きとブロックから出るときに、コードを呼び出します。以下のような構造を持つ言語"
1201
+ "があります::"
1132
1202
1133
1203
#: ../../faq/design.rst:666
1134
1204
msgid "In Python, such a construct would be ambiguous."
@@ -1170,13 +1240,21 @@ msgid ""
1170
1240
"variable named ``x``, will it be used inside the :keyword:`with` block? As "
1171
1241
"you see, the dynamic nature of Python makes such choices much harder."
1172
1242
msgstr ""
1243
+ "このコード片では、``a`` は ``x``. というメンバ属性を持っていると仮定されてい"
1244
+ "ます。しかし、Python ではインタプリタにはこの仮定を伝えられる仕組みはありませ"
1245
+ "ん。 ``a`` が、例えば整数だったら、どうなってしまうでしょうか。 ``x`` という"
1246
+ "名前のグローバル変数があったら、それが :keyword:`with` ブロックの中で使われる"
1247
+ "のでしょうか。この通り、Python の動的な特質から、このような選択はとても難しい"
1248
+ "物になっています。"
1173
1249
1174
1250
#: ../../faq/design.rst:691
1175
1251
msgid ""
1176
1252
"The primary benefit of :keyword:`with` and similar language features "
1177
1253
"(reduction of code volume) can, however, easily be achieved in Python by "
1178
1254
"assignment. Instead of::"
1179
1255
msgstr ""
1256
+ "しかし、:keyword:`with` やそれに類する言語の機能の一番の利点 (コード量の削"
1257
+ "減) は、 Python では代入により簡単に手に入れられます::"
1180
1258
1181
1259
#: ../../faq/design.rst:698
1182
1260
msgid "write this::"
0 commit comments