@@ -115,20 +115,29 @@ msgid ""
115115"to the :class:`Weekday` enum to extract the day from the :class:`date` "
116116"instance and return the matching enum member::"
117117msgstr ""
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メンバーを返すことができます::"
118125
119126#: ../../howto/enum.rst:82
120127msgid "The complete :class:`Weekday` enum now looks like this::"
121- msgstr ""
128+ msgstr "完全な :class:`Weekday` enumはこのようになります:: "
122129
123130#: ../../howto/enum.rst:97
124131msgid "Now we can find out what today is! Observe::"
125- msgstr ""
132+ msgstr "さて、これで今日が何曜日か調べることができます! 見てみましょう:: "
126133
127134#: ../../howto/enum.rst:103
128135msgid ""
129136"Of course, if you're reading this on some other day, you'll see that day "
130137"instead."
131138msgstr ""
139+ "もちろん、あなたがこれを読んでいるのが他の曜日ならば、その曜日が代わりに表示"
140+ "されます。"
132141
133142#: ../../howto/enum.rst:105
134143msgid ""
@@ -137,42 +146,52 @@ msgid ""
137146"during a week, and don't want to use a :class:`list` -- we could use a "
138147"different type of :class:`Enum`::"
139148msgstr ""
149+ "この :class:`Weekday` 列挙型は、変数が1つの曜日を必要とする場合には優れていま"
150+ "すが、複数必要な場合はどうでしょうか? 1週間の家事を記録する関数を作成してい"
151+ "て、listは使いたくない場合、別の型の :class:`Enum` を使用することができます::"
140152
141153#: ../../howto/enum.rst:120
142154msgid ""
143155"We've changed two things: we're inherited from :class:`Flag`, and the values "
144156"are all powers of 2."
145157msgstr ""
158+ "ここでは2つの変更が行われています。:class:`Flag` を継承している点と、値がすべ"
159+ "て2の累乗である点です。"
146160
147161#: ../../howto/enum.rst:123
148162msgid ""
149163"Just like the original :class:`Weekday` enum above, we can have a single "
150164"selection::"
151165msgstr ""
166+ "元々の :class:`Weekday` 列挙型と同じように、1つの要素を持つことができます::"
152167
153168#: ../../howto/enum.rst:129
154169msgid ""
155170"But :class:`Flag` also allows us to combine several members into a single "
156171"variable::"
157172msgstr ""
173+ "ただし、:class:`Flag` は複数のメンバーをひとつの変数にまとめることもできま"
174+ "す::"
158175
159176#: ../../howto/enum.rst:136
160177msgid "You can even iterate over a :class:`Flag` variable::"
161- msgstr ""
178+ msgstr ":class:`Flag` 変数は反復することもできます:: "
162179
163180#: ../../howto/enum.rst:143
164181msgid "Okay, let's get some chores set up::"
165- msgstr ""
182+ msgstr "さて、いくつかの家事を設定してみましょう:: "
166183
167184#: ../../howto/enum.rst:151
168185msgid "And a function to display the chores for a given day::"
169- msgstr ""
186+ msgstr "指定された日の家事を表示する関数も作成します:: "
170187
171188#: ../../howto/enum.rst:160
172189msgid ""
173190"In cases where the actual values of the members do not matter, you can save "
174191"yourself some work and use :func:`auto()` for the values::"
175192msgstr ""
193+ "メンバーの実際の値が重要でない場合は、:func:`auto()` を使用することで手間を省"
194+ "くことができます::"
176195
177196#: ../../howto/enum.rst:177
178197msgid "Programmatic access to enumeration members and their attributes"
@@ -214,6 +233,11 @@ msgid ""
214233"will return the member ``A``. By-name lookup of ``A`` will return the "
215234"member ``A``. By-name lookup of ``B`` will also return the member ``A``::"
216235msgstr ""
236+ "しかし、列挙型メンバー は、別の名前を持つことができます。 同じ値を持つ "
237+ "``A`` と``B`` が与えられた場合(そして ``A`` が先に定義されている場合)、 "
238+ "``B`` はメンバー ``A`` に対するエイリアスとなります。 ``A`` の値での検索で"
239+ "は、メンバー ``A`` が返されます。 ``A`` の名前での検索ではメンバー ``A`` を"
240+ "返します。``B`` の名前での検索も、メンバー ``A`` を返します::"
217241
218242#: ../../howto/enum.rst:238
219243msgid ""
@@ -233,6 +257,8 @@ msgid ""
233257"By default, enumerations allow multiple names as aliases for the same value. "
234258"When this behavior isn't desired, you can use the :func:`unique` decorator::"
235259msgstr ""
260+ "デフォルトでは、列挙型は同じ値のエイリアスとして複数の名前を許容します。この"
261+ "振る舞いを望まない場合は、 :func:`unique` デコレータを使用できます::"
236262
237263#: ../../howto/enum.rst:263
238264msgid "Using automatic values"
@@ -324,6 +350,11 @@ msgid ""
324350"doesn't care what the actual value of an enumeration is. But if the value "
325351"*is* important, enumerations can have arbitrary values."
326352msgstr ""
353+ "これまでのほとんどの例では、列挙型の値に整数を使用しています。 整数を使うの"
354+ "は短くて便利(そして、 `関数 API`_ ではデフォルトで設定される)ですが、これは"
355+ "強制されているわけではありません。大半の使用例では、列挙値の実際の値が何であ"
356+ "るかは意識しません。しかし、値が重要な場合、列挙型は任意の値を持つことができ"
357+ "ます。"
327358
328359#: ../../howto/enum.rst:369
329360msgid ""
@@ -477,6 +508,9 @@ msgid ""
477508"that ``0`` is ``False`` in a boolean sense, but by default enum members all "
478509"evaluate to ``True``."
479510msgstr ""
511+ "``0`` ではなく``1`` をデフォルトの開始番号とする理由は、``0`` が真偽値として"
512+ "は ``False`` であり、デフォルトの列挙メンバーはすべて ``True`` 評価されるよう"
513+ "にするためである。"
480514
481515#: ../../howto/enum.rst:508
482516msgid ""
@@ -661,6 +695,9 @@ msgid ""
661695"Bit-wise operations that result in invalid :class:`IntFlag` values will lose "
662696"the :class:`IntFlag` membership. See :class:`FlagBoundary` for details."
663697msgstr ""
698+ "ビット単位演算の結果が :class:`IntFlag` として不正な値な値の場合、値は :"
699+ "class:`IntFlag` メンバーではなくなります。 詳しくは :class:`FlagBoundary` を"
700+ "参照してください。"
664701
665702#: ../../howto/enum.rst:664
666703msgid "Sample :class:`IntFlag` class::"
@@ -675,6 +712,8 @@ msgid ""
675712"Named combinations are considered aliases. Aliases do not show up during "
676713"iteration, but can be returned from by-value lookups."
677714msgstr ""
715+ "組み合わせに名前をつけたものはエイリアスとみなされます。エイリアスはイテレー"
716+ "ション中には表示されませんが、値による検索では返却されます。"
678717
679718#: ../../howto/enum.rst:701
680719msgid ""
@@ -691,16 +730,20 @@ msgid ""
691730"Because :class:`IntFlag` members are also subclasses of :class:`int` they "
692731"can be combined with them (but may lose :class:`IntFlag` membership::"
693732msgstr ""
733+ ":class:`IntFlag` メンバーも :class:`int` のサブクラスであるため、それらと組み"
734+ "合わせることができます(ただし、 :class:`IntFlag` 型ではなくなる可能性があり"
735+ "ます)::"
694736
695737#: ../../howto/enum.rst:720
696738msgid ""
697739"The negation operator, ``~``, always returns an :class:`IntFlag` member with "
698740"a positive value::"
699741msgstr ""
742+ "否定の演算子,``~`` は、常に正の値を持つ:class:`IntFlag` メンバー を返す::"
700743
701744#: ../../howto/enum.rst:726
702745msgid ":class:`IntFlag` members can also be iterated over::"
703- msgstr ""
746+ msgstr ":class:`IntFlag` メンバーは反復処理することもできます:: "
704747
705748#: ../../howto/enum.rst:735
706749msgid "Flag"
@@ -1042,7 +1085,7 @@ msgstr ""
10421085
10431086#: ../../howto/enum.rst:993
10441087msgid "Plain :class:`Enum` classes always evaluate as :data:`True`."
1045- msgstr ""
1088+ msgstr "プレーンな :class:`Enum` クラスは :data:`True` として評価されます。 "
10461089
10471090#: ../../howto/enum.rst:997
10481091msgid "``Enum`` classes with methods"
@@ -1085,23 +1128,23 @@ msgstr ""
10851128
10861129#: ../../howto/enum.rst:1041
10871130msgid "Using the following snippet for our examples::"
1088- msgstr ""
1131+ msgstr "例として以下のスニペットを使用します:: "
10891132
10901133#: ../../howto/enum.rst:1052
10911134msgid "the following are true:"
10921135msgstr ""
10931136
10941137#: ../../howto/enum.rst:1054
10951138msgid "single-bit flags are canonical"
1096- msgstr ""
1139+ msgstr "単一ビットのフラグは正規形です "
10971140
10981141#: ../../howto/enum.rst:1055
10991142msgid "multi-bit and zero-bit flags are aliases"
1100- msgstr ""
1143+ msgstr "複数ビットや0ビットのフラグはエイリアスです "
11011144
11021145#: ../../howto/enum.rst:1056
11031146msgid "only canonical flags are returned during iteration::"
1104- msgstr ""
1147+ msgstr "反復処理では正規形のフラグのみ返却されます:: "
11051148
11061149#: ../../howto/enum.rst:1061
11071150msgid ""
@@ -1111,7 +1154,7 @@ msgstr ""
11111154
11121155#: ../../howto/enum.rst:1070
11131156msgid "names of pseudo-flags are constructed from their members' names::"
1114- msgstr ""
1157+ msgstr "名前のないフラグについては、そのメンバーの名前から名前が生成されます:: "
11151158
11161159#: ../../howto/enum.rst:1075
11171160msgid "multi-bit flags, aka aliases, can be returned from operations::"
@@ -1136,15 +1179,16 @@ msgstr ""
11361179
11371180#: ../../howto/enum.rst:1100
11381181msgid "STRICT --> raises an exception when presented with invalid values"
1139- msgstr ""
1182+ msgstr "STRICT --> 無効な値が指定された場合に例外を発生させる "
11401183
11411184#: ../../howto/enum.rst:1101
11421185msgid "CONFORM --> discards any invalid bits"
1143- msgstr ""
1186+ msgstr "CONFORM --> 無効なビットを破棄する "
11441187
11451188#: ../../howto/enum.rst:1102
11461189msgid "EJECT --> lose Flag status and become a normal int with the given value"
11471190msgstr ""
1191+ "EJECT --> フラグのステータスを失い、指定された値を持つ通常の int となります。"
11481192
11491193#: ../../howto/enum.rst:1106
11501194msgid "KEEP --> keep the extra bits"
0 commit comments