@@ -115,20 +115,29 @@ msgid ""
115
115
"to the :class:`Weekday` enum to extract the day from the :class:`date` "
116
116
"instance and return the matching enum member::"
117
117
msgstr ""
118
+ "多くの言語で列挙を名前と値のペアとしてのみ扱うのとは異なり、Pythonの列挙は振"
119
+ "る舞いを追加することができます。 例えば、 :class:`datetime.date` には曜日を"
120
+ "返すメソッドに :meth:`weekday` と :meth:`isoweekday` の2つがあります。違い"
121
+ "は、一方は0から6まで、もう一方は1から7まで数えることです。自分たちでそれらの"
122
+ "メソッドの挙動を理解しておく代わりに、:class:`Weekday` 列挙型にメソッドを追加"
123
+ "することで、 :class:`date` インスタンス から曜日を抽出し、それにマッチする"
124
+ "enumメンバーを返すことができます::"
118
125
119
126
#: ../../howto/enum.rst:82
120
127
msgid "The complete :class:`Weekday` enum now looks like this::"
121
- msgstr ""
128
+ msgstr "完全な :class:`Weekday` enumはこのようになります:: "
122
129
123
130
#: ../../howto/enum.rst:97
124
131
msgid "Now we can find out what today is! Observe::"
125
- msgstr ""
132
+ msgstr "さて、これで今日が何曜日か調べることができます! 見てみましょう:: "
126
133
127
134
#: ../../howto/enum.rst:103
128
135
msgid ""
129
136
"Of course, if you're reading this on some other day, you'll see that day "
130
137
"instead."
131
138
msgstr ""
139
+ "もちろん、あなたがこれを読んでいるのが他の曜日ならば、その曜日が代わりに表示"
140
+ "されます。"
132
141
133
142
#: ../../howto/enum.rst:105
134
143
msgid ""
@@ -137,42 +146,52 @@ msgid ""
137
146
"during a week, and don't want to use a :class:`list` -- we could use a "
138
147
"different type of :class:`Enum`::"
139
148
msgstr ""
149
+ "この :class:`Weekday` 列挙型は、変数が1つの曜日を必要とする場合には優れていま"
150
+ "すが、複数必要な場合はどうでしょうか? 1週間の家事を記録する関数を作成してい"
151
+ "て、listは使いたくない場合、別の型の :class:`Enum` を使用することができます::"
140
152
141
153
#: ../../howto/enum.rst:120
142
154
msgid ""
143
155
"We've changed two things: we're inherited from :class:`Flag`, and the values "
144
156
"are all powers of 2."
145
157
msgstr ""
158
+ "ここでは2つの変更が行われています。:class:`Flag` を継承している点と、値がすべ"
159
+ "て2の累乗である点です。"
146
160
147
161
#: ../../howto/enum.rst:123
148
162
msgid ""
149
163
"Just like the original :class:`Weekday` enum above, we can have a single "
150
164
"selection::"
151
165
msgstr ""
166
+ "元々の :class:`Weekday` 列挙型と同じように、1つの要素を持つことができます::"
152
167
153
168
#: ../../howto/enum.rst:129
154
169
msgid ""
155
170
"But :class:`Flag` also allows us to combine several members into a single "
156
171
"variable::"
157
172
msgstr ""
173
+ "ただし、:class:`Flag` は複数のメンバーをひとつの変数にまとめることもできま"
174
+ "す::"
158
175
159
176
#: ../../howto/enum.rst:136
160
177
msgid "You can even iterate over a :class:`Flag` variable::"
161
- msgstr ""
178
+ msgstr ":class:`Flag` 変数は反復することもできます:: "
162
179
163
180
#: ../../howto/enum.rst:143
164
181
msgid "Okay, let's get some chores set up::"
165
- msgstr ""
182
+ msgstr "さて、いくつかの家事を設定してみましょう:: "
166
183
167
184
#: ../../howto/enum.rst:151
168
185
msgid "And a function to display the chores for a given day::"
169
- msgstr ""
186
+ msgstr "指定された日の家事を表示する関数も作成します:: "
170
187
171
188
#: ../../howto/enum.rst:160
172
189
msgid ""
173
190
"In cases where the actual values of the members do not matter, you can save "
174
191
"yourself some work and use :func:`auto()` for the values::"
175
192
msgstr ""
193
+ "メンバーの実際の値が重要でない場合は、:func:`auto()` を使用することで手間を省"
194
+ "くことができます::"
176
195
177
196
#: ../../howto/enum.rst:177
178
197
msgid "Programmatic access to enumeration members and their attributes"
@@ -214,6 +233,11 @@ msgid ""
214
233
"will return the member ``A``. By-name lookup of ``A`` will return the "
215
234
"member ``A``. By-name lookup of ``B`` will also return the member ``A``::"
216
235
msgstr ""
236
+ "しかし、列挙型メンバー は、別の名前を持つことができます。 同じ値を持つ "
237
+ "``A`` と``B`` が与えられた場合(そして ``A`` が先に定義されている場合)、 "
238
+ "``B`` はメンバー ``A`` に対するエイリアスとなります。 ``A`` の値での検索で"
239
+ "は、メンバー ``A`` が返されます。 ``A`` の名前での検索ではメンバー ``A`` を"
240
+ "返します。``B`` の名前での検索も、メンバー ``A`` を返します::"
217
241
218
242
#: ../../howto/enum.rst:238
219
243
msgid ""
@@ -233,6 +257,8 @@ msgid ""
233
257
"By default, enumerations allow multiple names as aliases for the same value. "
234
258
"When this behavior isn't desired, you can use the :func:`unique` decorator::"
235
259
msgstr ""
260
+ "デフォルトでは、列挙型は同じ値のエイリアスとして複数の名前を許容します。この"
261
+ "振る舞いを望まない場合は、 :func:`unique` デコレータを使用できます::"
236
262
237
263
#: ../../howto/enum.rst:263
238
264
msgid "Using automatic values"
@@ -324,6 +350,11 @@ msgid ""
324
350
"doesn't care what the actual value of an enumeration is. But if the value "
325
351
"*is* important, enumerations can have arbitrary values."
326
352
msgstr ""
353
+ "これまでのほとんどの例では、列挙型の値に整数を使用しています。 整数を使うの"
354
+ "は短くて便利(そして、 `関数 API`_ ではデフォルトで設定される)ですが、これは"
355
+ "強制されているわけではありません。大半の使用例では、列挙値の実際の値が何であ"
356
+ "るかは意識しません。しかし、値が重要な場合、列挙型は任意の値を持つことができ"
357
+ "ます。"
327
358
328
359
#: ../../howto/enum.rst:369
329
360
msgid ""
@@ -477,6 +508,9 @@ msgid ""
477
508
"that ``0`` is ``False`` in a boolean sense, but by default enum members all "
478
509
"evaluate to ``True``."
479
510
msgstr ""
511
+ "``0`` ではなく``1`` をデフォルトの開始番号とする理由は、``0`` が真偽値として"
512
+ "は ``False`` であり、デフォルトの列挙メンバーはすべて ``True`` 評価されるよう"
513
+ "にするためである。"
480
514
481
515
#: ../../howto/enum.rst:508
482
516
msgid ""
@@ -661,6 +695,9 @@ msgid ""
661
695
"Bit-wise operations that result in invalid :class:`IntFlag` values will lose "
662
696
"the :class:`IntFlag` membership. See :class:`FlagBoundary` for details."
663
697
msgstr ""
698
+ "ビット単位演算の結果が :class:`IntFlag` として不正な値な値の場合、値は :"
699
+ "class:`IntFlag` メンバーではなくなります。 詳しくは :class:`FlagBoundary` を"
700
+ "参照してください。"
664
701
665
702
#: ../../howto/enum.rst:664
666
703
msgid "Sample :class:`IntFlag` class::"
@@ -675,6 +712,8 @@ msgid ""
675
712
"Named combinations are considered aliases. Aliases do not show up during "
676
713
"iteration, but can be returned from by-value lookups."
677
714
msgstr ""
715
+ "組み合わせに名前をつけたものはエイリアスとみなされます。エイリアスはイテレー"
716
+ "ション中には表示されませんが、値による検索では返却されます。"
678
717
679
718
#: ../../howto/enum.rst:701
680
719
msgid ""
@@ -691,16 +730,20 @@ msgid ""
691
730
"Because :class:`IntFlag` members are also subclasses of :class:`int` they "
692
731
"can be combined with them (but may lose :class:`IntFlag` membership::"
693
732
msgstr ""
733
+ ":class:`IntFlag` メンバーも :class:`int` のサブクラスであるため、それらと組み"
734
+ "合わせることができます(ただし、 :class:`IntFlag` 型ではなくなる可能性があり"
735
+ "ます)::"
694
736
695
737
#: ../../howto/enum.rst:720
696
738
msgid ""
697
739
"The negation operator, ``~``, always returns an :class:`IntFlag` member with "
698
740
"a positive value::"
699
741
msgstr ""
742
+ "否定の演算子,``~`` は、常に正の値を持つ:class:`IntFlag` メンバー を返す::"
700
743
701
744
#: ../../howto/enum.rst:726
702
745
msgid ":class:`IntFlag` members can also be iterated over::"
703
- msgstr ""
746
+ msgstr ":class:`IntFlag` メンバーは反復処理することもできます:: "
704
747
705
748
#: ../../howto/enum.rst:735
706
749
msgid "Flag"
@@ -1042,7 +1085,7 @@ msgstr ""
1042
1085
1043
1086
#: ../../howto/enum.rst:993
1044
1087
msgid "Plain :class:`Enum` classes always evaluate as :data:`True`."
1045
- msgstr ""
1088
+ msgstr "プレーンな :class:`Enum` クラスは :data:`True` として評価されます。 "
1046
1089
1047
1090
#: ../../howto/enum.rst:997
1048
1091
msgid "``Enum`` classes with methods"
@@ -1085,23 +1128,23 @@ msgstr ""
1085
1128
1086
1129
#: ../../howto/enum.rst:1041
1087
1130
msgid "Using the following snippet for our examples::"
1088
- msgstr ""
1131
+ msgstr "例として以下のスニペットを使用します:: "
1089
1132
1090
1133
#: ../../howto/enum.rst:1052
1091
1134
msgid "the following are true:"
1092
1135
msgstr ""
1093
1136
1094
1137
#: ../../howto/enum.rst:1054
1095
1138
msgid "single-bit flags are canonical"
1096
- msgstr ""
1139
+ msgstr "単一ビットのフラグは正規形です "
1097
1140
1098
1141
#: ../../howto/enum.rst:1055
1099
1142
msgid "multi-bit and zero-bit flags are aliases"
1100
- msgstr ""
1143
+ msgstr "複数ビットや0ビットのフラグはエイリアスです "
1101
1144
1102
1145
#: ../../howto/enum.rst:1056
1103
1146
msgid "only canonical flags are returned during iteration::"
1104
- msgstr ""
1147
+ msgstr "反復処理では正規形のフラグのみ返却されます:: "
1105
1148
1106
1149
#: ../../howto/enum.rst:1061
1107
1150
msgid ""
@@ -1111,7 +1154,7 @@ msgstr ""
1111
1154
1112
1155
#: ../../howto/enum.rst:1070
1113
1156
msgid "names of pseudo-flags are constructed from their members' names::"
1114
- msgstr ""
1157
+ msgstr "名前のないフラグについては、そのメンバーの名前から名前が生成されます:: "
1115
1158
1116
1159
#: ../../howto/enum.rst:1075
1117
1160
msgid "multi-bit flags, aka aliases, can be returned from operations::"
@@ -1136,15 +1179,16 @@ msgstr ""
1136
1179
1137
1180
#: ../../howto/enum.rst:1100
1138
1181
msgid "STRICT --> raises an exception when presented with invalid values"
1139
- msgstr ""
1182
+ msgstr "STRICT --> 無効な値が指定された場合に例外を発生させる "
1140
1183
1141
1184
#: ../../howto/enum.rst:1101
1142
1185
msgid "CONFORM --> discards any invalid bits"
1143
- msgstr ""
1186
+ msgstr "CONFORM --> 無効なビットを破棄する "
1144
1187
1145
1188
#: ../../howto/enum.rst:1102
1146
1189
msgid "EJECT --> lose Flag status and become a normal int with the given value"
1147
1190
msgstr ""
1191
+ "EJECT --> フラグのステータスを失い、指定された値を持つ通常の int となります。"
1148
1192
1149
1193
#: ../../howto/enum.rst:1106
1150
1194
msgid "KEEP --> keep the extra bits"
0 commit comments