@@ -72,6 +72,9 @@ msgid ""
72
72
" exceptions described below, nothing in :func:`dataclass` examines the type "
73
73
"specified in the variable annotation."
74
74
msgstr ""
75
+ ":func:`dataclass` デコレータは、``フィールド`` を探すためにクラスを検査します。``フィールド`` "
76
+ "の定義は型アノテーションを持つクラス変数です。後述する2つの例外を除き、:func:`dataclass` "
77
+ "は、変数アノテーションで指定した型を検査しません。"
75
78
76
79
#: ../../library/dataclasses.rst:58
77
80
msgid ""
@@ -87,7 +90,7 @@ msgid ""
87
90
"decorator returns the same class that is called on; no new class is created."
88
91
msgstr ""
89
92
":func:`dataclass` デコレータは、後述する様々な \" ダンダー\" メソッド (訳注:dunderはdouble "
90
- "underscoreの略で、前と後ろそれぞれにアンダースコアが2つ付いているメソッド ) "
93
+ "underscoreの略で、メソッド名の前後にアンダースコアが2つ付いているメソッド ) "
91
94
"をクラスに追加します。クラスに既にこれらのメソッドが存在する場合の動作は、後述する引数によって異なります。デコレータは呼び出した際に指定したクラスと同じクラスを返します。新しいクラスは生成されません。"
92
95
93
96
#: ../../library/dataclasses.rst:67
@@ -97,7 +100,7 @@ msgid ""
97
100
"is, these three uses of :func:`dataclass` are equivalent::"
98
101
msgstr ""
99
102
":func:`dataclass` "
100
- "が引数を指定しない単純なデコレータとして使用された場合、シグネチャに文書化されたデフォルト値のとおりに動作します 。つまり、以下の3つの "
103
+ "が引数を指定しない単純なデコレータとして使用された場合、ドキュメントに記載されているシグネチャのデフォルト値のとおりに動作します 。つまり、以下の3つの "
101
104
":func:`dataclass` の用例は同等です::"
102
105
103
106
#: ../../library/dataclasses.rst:84
@@ -108,7 +111,7 @@ msgstr ":func:`dataclass` の引数は以下の通りです::"
108
111
msgid ""
109
112
"``init``: If true (the default), a :meth:`__init__` method will be "
110
113
"generated."
111
- msgstr "``init``: true (デフォルト値) を指定すると 、 :meth:`__init__` メソッドが生成されます。"
114
+ msgstr "``init``: (デフォルトの)真の場合 、 :meth:`__init__` メソッドが生成されます。"
112
115
113
116
#: ../../library/dataclasses.rst:89
114
117
msgid ""
@@ -124,7 +127,7 @@ msgid ""
124
127
"example: ``InventoryItem(name='widget', unit_price=3.0, "
125
128
"quantity_on_hand=10)``."
126
129
msgstr ""
127
- "``repr``: (デフォルトの) 真の場合、 :meth:`__repr__` メソッドが生成されます。\n"
130
+ "``repr``: (デフォルトの)真の場合、 :meth:`__repr__` メソッドが生成されます。\n"
128
131
"生成された repr 文字列には、クラス名、各フィールドの名前および repr 文字列が、クラス上での定義された順序で並びます。\n"
129
132
"repr から除外するように印が付けられたフィールドは、 repr 文字列には含まれません。\n"
130
133
"例えば、このようになります: ``InventoryItem(name='widget', unit_price=3.0, quantity_on_hand=10)`` 。"
@@ -140,7 +143,7 @@ msgid ""
140
143
"This method compares the class as if it were a tuple of its fields, in "
141
144
"order. Both instances in the comparison must be of the identical type."
142
145
msgstr ""
143
- "``eq``: true (デフォルト値) を指定すると 、 :meth:`__eq__` "
146
+ "``eq``: (デフォルトの)真の場合 、 :meth:`__eq__` "
144
147
"メソッドが生成されます。このメソッドはクラスの比較を、そのクラスのフィールドからなるタプルを比較するように行います。比較する2つのインスタンスのクラスは同一でなければなりません。"
145
148
146
149
#: ../../library/dataclasses.rst:107
@@ -156,7 +159,7 @@ msgid ""
156
159
"order. Both instances in the comparison must be of the identical type. If "
157
160
"``order`` is true and ``eq`` is false, a :exc:`ValueError` is raised."
158
161
msgstr ""
159
- "``order``: true を指定すると(デフォルト値は ``False``です) 、 "
162
+ "``order``: 真 (デフォルト値 ``False``) の場合 、 "
160
163
":meth:`__lt__`、:meth:`__le__`、:meth:`__gt__`、:meth:`__ge__` "
161
164
"メソッドが生成されます。これらの比較は、クラスをそのフィールドからなるタプルであるかのように取り扱います。比較される2つのインスタンスは、同一の型でなければなりません。もし"
162
165
" ``order`` が true で、 ``eq`` に falseを指定すすると、:exc:`ValueError` が送出されます。"
@@ -166,14 +169,16 @@ msgid ""
166
169
"If the class already defines any of :meth:`__lt__`, :meth:`__le__`, "
167
170
":meth:`__gt__`, or :meth:`__ge__`, then :exc:`TypeError` is raised."
168
171
msgstr ""
169
- "もし、クラスで既に :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, または :meth:`__ge__`"
170
- " のいずれかが定義されていると :exc:`TypeError` が送出されます。"
172
+ "もし、クラスで既に :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, :meth:`__ge__` "
173
+ "のうちいずれかが定義されていると :exc:`TypeError` が送出されます。"
171
174
172
175
#: ../../library/dataclasses.rst:121
173
176
msgid ""
174
177
"``unsafe_hash``: If ``False`` (the default), a :meth:`__hash__` method is "
175
178
"generated according to how ``eq`` and ``frozen`` are set."
176
179
msgstr ""
180
+ "``unsafe_hash``: (デフォルトの)``False`` の場合、 ``eq`` と ``frozen`` がどう設定されているかに従って "
181
+ ":meth:`__hash__` メソッドが生成されます。"
177
182
178
183
#: ../../library/dataclasses.rst:124
179
184
msgid ""
@@ -250,7 +255,7 @@ msgid ""
250
255
" field with a default value. This is true either when this occurs in a "
251
256
"single class, or as a result of class inheritance."
252
257
msgstr ""
253
- "デフォルト値を指定しないフィールドをデフォルト値を指定したフィールドの後ろに定義すると 、 :exc:`TypeError` "
258
+ "デフォルト値を指定しないフィールドを、デフォルト値を指定したフィールドの後ろに定義すると 、 :exc:`TypeError` "
254
259
"が送出されます。これは、単一のクラスであっても、クラス継承の結果でも起きえます。"
255
260
256
261
#: ../../library/dataclasses.rst:181
@@ -272,7 +277,7 @@ msgstr ""
272
277
273
278
#: ../../library/dataclasses.rst:200
274
279
msgid "The parameters to :func:`field` are:"
275
- msgstr ""
280
+ msgstr ":func:`field` の引数は: "
276
281
277
282
#: ../../library/dataclasses.rst:202
278
283
msgid ""
@@ -294,19 +299,22 @@ msgstr ""
294
299
msgid ""
295
300
"``init``: If true (the default), this field is included as a parameter to "
296
301
"the generated :meth:`__init__` method."
297
- msgstr ""
302
+ msgstr "``init``: (デフォルトの)真の場合、 生成される :meth:`__init__` メソッドの引数にこのフィールドを含めます。 "
298
303
299
304
#: ../../library/dataclasses.rst:215
300
305
msgid ""
301
306
"``repr``: If true (the default), this field is included in the string "
302
307
"returned by the generated :meth:`__repr__` method."
303
308
msgstr ""
309
+ "``repr``: (デフォルトの)真の場合、生成される :meth:`__repr__` メソッドによって返される文字列に、このフィールドを含めます。"
304
310
305
311
#: ../../library/dataclasses.rst:218
306
312
msgid ""
307
313
"``compare``: If true (the default), this field is included in the generated "
308
314
"equality and comparison methods (:meth:`__eq__`, :meth:`__gt__`, et al.)."
309
315
msgstr ""
316
+ "``compare``: (デフォルトの) 真の場合、生成される等価関数と比較関数( :meth:`__eq__` 、:meth:`__gt__` "
317
+ "など)にこのフィールドを含めます。"
310
318
311
319
#: ../../library/dataclasses.rst:222
312
320
msgid ""
0 commit comments