@@ -197,13 +197,18 @@ msgid ""
197
197
"make your type compatible with the :mod:`pydoc` and :mod:`pickle` modules. "
198
198
"::"
199
199
msgstr ""
200
+ "型の名前が、モジュール名とモジュールにおける型の名前の両方をドットでつないだ名前になっていることに注意してください。\n"
201
+ "この場合は、モジュールは :mod:`custom` で型は :class:`Custom` なので、型の名前を :class:`custom.Custom` に設定しました。\n"
202
+ "実際のドット付きのインポートパスを使うのは、 :mod:`pydoc` モジュールや :mod:`pickle` モジュールと互換性を持たせるために重要なのです。"
200
203
201
204
#: ../../extending/newtypes_tutorial.rst:136
202
205
msgid ""
203
206
"This is so that Python knows how much memory to allocate when creating new "
204
207
":class:`Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only "
205
208
"used for variable-sized objects and should otherwise be zero."
206
209
msgstr ""
210
+ ":c:member:`~PyTypeObject.tp_basicsize` は、新しい :class:`Custom` インスタンスを作るとき Python が割り当てるべきメモリがどのくらいなのかを知るためのものです。\n"
211
+ ":c:member:`~PyTypeObject.tp_itemsize` は可変サイズのオブジェクトでのみ使うものなので、サイズが可変でないオブジェクトでは 0 にすべきです。"
207
212
208
213
#: ../../extending/newtypes_tutorial.rst:142
209
214
msgid ""
@@ -229,7 +234,7 @@ msgstr ""
229
234
230
235
#: ../../extending/newtypes_tutorial.rst:152
231
236
msgid "We set the class flags to :const:`Py_TPFLAGS_DEFAULT`. ::"
232
- msgstr ""
237
+ msgstr ":const:`Py_TPFLAGS_DEFAULT` にクラスフラグを設定します。 :: "
233
238
234
239
#: ../../extending/newtypes_tutorial.rst:156
235
240
msgid ""
@@ -253,31 +258,41 @@ msgid ""
253
258
"case, we can just use the default implementation provided by the API "
254
259
"function :c:func:`PyType_GenericNew`. ::"
255
260
msgstr ""
261
+ "オブジェクトが生成できるように、 :c:member:`~PyTypeObject.tp_new` ハンドラを提供する必要があります。\n"
262
+ "これは Python のメソッド :meth:`__new__` と同等のものですが、明示的に与える必要があります。\n"
263
+ "今の場合では、 API 関数の :c:func:`PyType_GenericNew` として提供されるデフォルトをそのまま使えます。 ::"
256
264
257
265
#: ../../extending/newtypes_tutorial.rst:171
258
266
msgid ""
259
267
"Everything else in the file should be familiar, except for some code in "
260
268
":c:func:`PyInit_custom`::"
261
269
msgstr ""
270
+ "ファイルの残りの部分はきっと馴染みやすいものだと思いますが、 :c:func:`PyInit_custom` の一部のコードはそうではないでしょう::"
262
271
263
272
#: ../../extending/newtypes_tutorial.rst:177
264
273
msgid ""
265
274
"This initializes the :class:`Custom` type, filling in a number of members to"
266
275
" the appropriate default values, including :attr:`ob_type` that we initially"
267
276
" set to *NULL*. ::"
268
277
msgstr ""
278
+ "これは、 *NULL* に初期化された :attr:`ob_type` も含めて、いくつかのメンバーを適切なデフォルト値で埋めて、 "
279
+ ":class:`Custom` 型を初期化します。 ::"
269
280
270
281
#: ../../extending/newtypes_tutorial.rst:183
271
282
msgid ""
272
283
"This adds the type to the module dictionary. This allows us to create "
273
284
":class:`Custom` instances by calling the :class:`Custom` class:"
274
285
msgstr ""
286
+ "これは型をモジュールの辞書に追加します。\n"
287
+ "こうすることで :class:`Custom` クラスの呼び出しで :class:`Custom` インスタンスが作成できるようになります:"
275
288
276
289
#: ../../extending/newtypes_tutorial.rst:191
277
290
msgid ""
278
291
"That's it! All that remains is to build it; put the above code in a file "
279
292
"called :file:`custom.c` and:"
280
293
msgstr ""
294
+ "以上です!\n"
295
+ "残りの作業はビルドだけです; :file:`custom.c` という名前のファイルにここまでのコードを書き込み、次の内容を持つ setup.py を用意します:"
281
296
282
297
#: ../../extending/newtypes_tutorial.rst:200
283
298
msgid "in a file called :file:`setup.py`; then typing"
0 commit comments