@@ -197,13 +197,18 @@ msgid ""
197197"make your type compatible with the :mod:`pydoc` and :mod:`pickle` modules. "
198198"::"
199199msgstr ""
200+ "型の名前が、モジュール名とモジュールにおける型の名前の両方をドットでつないだ名前になっていることに注意してください。\n"
201+ "この場合は、モジュールは :mod:`custom` で型は :class:`Custom` なので、型の名前を :class:`custom.Custom` に設定しました。\n"
202+ "実際のドット付きのインポートパスを使うのは、 :mod:`pydoc` モジュールや :mod:`pickle` モジュールと互換性を持たせるために重要なのです。"
200203
201204#: ../../extending/newtypes_tutorial.rst:136
202205msgid ""
203206"This is so that Python knows how much memory to allocate when creating new "
204207":class:`Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only "
205208"used for variable-sized objects and should otherwise be zero."
206209msgstr ""
210+ ":c:member:`~PyTypeObject.tp_basicsize` は、新しい :class:`Custom` インスタンスを作るとき Python が割り当てるべきメモリがどのくらいなのかを知るためのものです。\n"
211+ ":c:member:`~PyTypeObject.tp_itemsize` は可変サイズのオブジェクトでのみ使うものなので、サイズが可変でないオブジェクトでは 0 にすべきです。"
207212
208213#: ../../extending/newtypes_tutorial.rst:142
209214msgid ""
@@ -229,7 +234,7 @@ msgstr ""
229234
230235#: ../../extending/newtypes_tutorial.rst:152
231236msgid "We set the class flags to :const:`Py_TPFLAGS_DEFAULT`. ::"
232- msgstr ""
237+ msgstr ":const:`Py_TPFLAGS_DEFAULT` にクラスフラグを設定します。 :: "
233238
234239#: ../../extending/newtypes_tutorial.rst:156
235240msgid ""
@@ -253,31 +258,41 @@ msgid ""
253258"case, we can just use the default implementation provided by the API "
254259"function :c:func:`PyType_GenericNew`. ::"
255260msgstr ""
261+ "オブジェクトが生成できるように、 :c:member:`~PyTypeObject.tp_new` ハンドラを提供する必要があります。\n"
262+ "これは Python のメソッド :meth:`__new__` と同等のものですが、明示的に与える必要があります。\n"
263+ "今の場合では、 API 関数の :c:func:`PyType_GenericNew` として提供されるデフォルトをそのまま使えます。 ::"
256264
257265#: ../../extending/newtypes_tutorial.rst:171
258266msgid ""
259267"Everything else in the file should be familiar, except for some code in "
260268":c:func:`PyInit_custom`::"
261269msgstr ""
270+ "ファイルの残りの部分はきっと馴染みやすいものだと思いますが、 :c:func:`PyInit_custom` の一部のコードはそうではないでしょう::"
262271
263272#: ../../extending/newtypes_tutorial.rst:177
264273msgid ""
265274"This initializes the :class:`Custom` type, filling in a number of members to"
266275" the appropriate default values, including :attr:`ob_type` that we initially"
267276" set to *NULL*. ::"
268277msgstr ""
278+ "これは、 *NULL* に初期化された :attr:`ob_type` も含めて、いくつかのメンバーを適切なデフォルト値で埋めて、 "
279+ ":class:`Custom` 型を初期化します。 ::"
269280
270281#: ../../extending/newtypes_tutorial.rst:183
271282msgid ""
272283"This adds the type to the module dictionary. This allows us to create "
273284":class:`Custom` instances by calling the :class:`Custom` class:"
274285msgstr ""
286+ "これは型をモジュールの辞書に追加します。\n"
287+ "こうすることで :class:`Custom` クラスの呼び出しで :class:`Custom` インスタンスが作成できるようになります:"
275288
276289#: ../../extending/newtypes_tutorial.rst:191
277290msgid ""
278291"That's it! All that remains is to build it; put the above code in a file "
279292"called :file:`custom.c` and:"
280293msgstr ""
294+ "以上です!\n"
295+ "残りの作業はビルドだけです; :file:`custom.c` という名前のファイルにここまでのコードを書き込み、次の内容を持つ setup.py を用意します:"
281296
282297#: ../../extending/newtypes_tutorial.rst:200
283298msgid "in a file called :file:`setup.py`; then typing"
0 commit comments