7
7
# Arihiro TAKASE, 2018
8
8
# Nozomu Kaneko <nozom.kaneko@gmail.com>, 2018
9
9
# 秘湯 <xwhhsprings@gmail.com>, 2018
10
- # Osamu NAKAMURA, 2018
11
10
# tomo, 2018
11
+ # Osamu NAKAMURA, 2019
12
12
#
13
13
#, fuzzy
14
14
msgid ""
@@ -17,7 +17,7 @@ msgstr ""
17
17
"Report-Msgid-Bugs-To : \n "
18
18
"POT-Creation-Date : 2019-04-23 11:14+0900\n "
19
19
"PO-Revision-Date : 2018-04-08 04:04+0000\n "
20
- "Last-Translator : tomo, 2018 \n "
20
+ "Last-Translator : Osamu NAKAMURA, 2019 \n "
21
21
"Language-Team : Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n "
22
22
"MIME-Version : 1.0\n "
23
23
"Content-Type : text/plain; charset=UTF-8\n "
@@ -311,6 +311,8 @@ msgid ""
311
311
"to that directory and fire up Python --- you should be able to ``import "
312
312
"custom`` and play around with Custom objects."
313
313
msgstr ""
314
+ "すると :file:`custom.so` ファイルがサブディレクトリに生成されます。そのディレクトリに移動して、Pythonを起動します -- これで"
315
+ " ``import custom`` して、Custom オブジェクトで遊べるようになっているはずです。"
314
316
315
317
#: ../../extending/newtypes_tutorial.rst:211
316
318
msgid "That wasn't so hard, was it?"
@@ -321,6 +323,7 @@ msgid ""
321
323
"Of course, the current Custom type is pretty uninteresting. It has no data "
322
324
"and doesn't do anything. It can't even be subclassed."
323
325
msgstr ""
326
+ "もちろん、現在の Custom 型は面白みに欠けています。何もデータを持っていないし、何もできません。継承してサブクラスを作ることさえできないのです。"
324
327
325
328
#: ../../extending/newtypes_tutorial.rst:217
326
329
msgid ""
@@ -331,6 +334,11 @@ msgid ""
331
334
"Packaging User's Guide <https://packaging.python.org/tutorials/distributing-"
332
335
"packages/>`_."
333
336
msgstr ""
337
+ "この文書では、標準の :mod:`distutils` モジュールを使って C "
338
+ "拡張をビルドしていますが、現実のユースケースでは、より新しく、保守されている ``setuptools`` "
339
+ "ライブラリを利用することを推奨します。これを行う方法を文書化することはこのドキュメントの範囲外ですので、 `Python Packaging "
340
+ "User's Guide <https://packaging.python.org/tutorials/distributing-"
341
+ "packages/>`_ を参照してください。"
334
342
335
343
#: ../../extending/newtypes_tutorial.rst:225
336
344
msgid "Adding data and methods to the Basic example"
@@ -342,6 +350,8 @@ msgid ""
342
350
"make the type usable as a base class. We'll create a new module, "
343
351
":mod:`custom2` that adds these capabilities:"
344
352
msgstr ""
353
+ "この基本のサンプルにデータとメソッドを追加してみましょう。ついでに、この型を基底クラスとしても利用できるようにします。ここでは新しいモジュール "
354
+ ":mod:`custom2` をつくり、これらの機能を追加します:"
345
355
346
356
#: ../../extending/newtypes_tutorial.rst:234
347
357
msgid "This version of the module has a number of changes."
@@ -364,6 +374,9 @@ msgid ""
364
374
"strings containing first and last names. The *number* attribute is a C "
365
375
"integer."
366
376
msgstr ""
377
+ ":class:`Custom` 型は そのC構造体に 3つのデータ属性 *first* 、 *last* 、および *number* "
378
+ "をもつようになりました。 *first* と *last* 属性はファーストネームとラストネームを格納した Python 文字列で、 *number* "
379
+ "属性は C言語での整数の値です。"
367
380
368
381
#: ../../extending/newtypes_tutorial.rst:247
369
382
msgid "The object structure is updated accordingly::"
@@ -390,6 +403,11 @@ msgid ""
390
403
" might not be :class:`CustomType`, because the object may be an instance of "
391
404
"a subclass."
392
405
msgstr ""
406
+ "このメソッドは、まず二つのPython 属性の参照カウントをクリアします。 :c:func:`Py_XDECREF` は引数が *NULL* "
407
+ "のケースを正しく扱えます( これは、``tp_new`` が途中で失敗した場合に起こりえます)。つぎにオブジェクトの型 "
408
+ "(``Py_TYPE(self)`` で算出します)のメンバ :c:member:`~PyTypeObject.tp_free` "
409
+ "を呼び出し、オブジェクトのメモリを開放します。オブジェクトはサブクラスのインスタンスかもしれず、その場合オブジェクトの型が "
410
+ ":class:`CustomType` とは限らない点に注意してください。"
393
411
394
412
#: ../../extending/newtypes_tutorial.rst:280
395
413
msgid ""
@@ -404,7 +422,7 @@ msgstr ""
404
422
msgid ""
405
423
"We want to make sure that the first and last names are initialized to empty "
406
424
"strings, so we provide a ``tp_new`` implementation::"
407
- msgstr ""
425
+ msgstr "ファーストネームとラストネームを空文字列に初期化しておきたいので、``tp_new`` の実装を追加することにしましょう:: "
408
426
409
427
#: ../../extending/newtypes_tutorial.rst:310
410
428
msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::"
@@ -435,19 +453,22 @@ msgstr ""
435
453
msgid ""
436
454
"``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do"
437
455
" it itself."
438
- msgstr ""
456
+ msgstr "``tp_new`` は明示的に ``tp_init`` を呼び出してはいけません、これはインタープリタが自分で行うためです。 "
439
457
440
458
#: ../../extending/newtypes_tutorial.rst:333
441
459
msgid ""
442
460
"The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` "
443
461
"slot to allocate memory::"
444
462
msgstr ""
463
+ "この ``tp_new`` の実装は、:c:member:`~PyTypeObject.tp_alloc` スロットを呼び出してメモリを割り当てます::"
445
464
446
465
#: ../../extending/newtypes_tutorial.rst:338
447
466
msgid ""
448
467
"Since memory allocation may fail, we must check the "
449
468
":c:member:`~PyTypeObject.tp_alloc` result against *NULL* before proceeding."
450
469
msgstr ""
470
+ "メモリ割り当ては失敗するかもしれないので、先に進む前に :c:member:`~PyTypeObject.tp_alloc` "
471
+ "の結果がNULLでないかチェックしなければなりません。"
451
472
452
473
#: ../../extending/newtypes_tutorial.rst:342
453
474
msgid ""
@@ -525,7 +546,7 @@ msgstr ""
525
546
526
547
#: ../../extending/newtypes_tutorial.rst:421
527
548
msgid "when we absolutely know that the reference count is greater than 1;"
528
- msgstr ""
549
+ msgstr "その参照カウントが 1 より大きいと確信できる場合 "
529
550
530
551
#: ../../extending/newtypes_tutorial.rst:423
531
552
msgid ""
@@ -579,6 +600,8 @@ msgid ""
579
600
"We define a single method, :meth:`Custom.name()`, that outputs the objects "
580
601
"name as the concatenation of the first and last names. ::"
581
602
msgstr ""
603
+ "ここでは :meth:`Custom.name()` と呼ばれるメソッドを定義しましょう。これはファーストネーム first とラストネーム last "
604
+ "を連結した文字列をそのオブジェクトの名前として返します。 ::"
582
605
583
606
#: ../../extending/newtypes_tutorial.rst:474
584
607
msgid ""
@@ -589,6 +612,9 @@ msgid ""
589
612
" to accept a positional argument tuple or keyword argument dictionary. This "
590
613
"method is equivalent to the Python method:"
591
614
msgstr ""
615
+ "このメソッドは C 関数として実装され、 :class:`Custom` (あるいは :class:`Custom` のサブクラス) "
616
+ "のインスタンスを第一引数として受けとります。メソッドはつねにそのインスタンスを最初の引数として受けとらなければなりません。しばしば位置引数とキーワード引数も受けとりますが、今回はなにも必要ないので、固定引数のタプルもキーワード引数の辞書も取らないことにします。このメソッドは"
617
+ " Python の以下のメソッドと等価です:"
592
618
593
619
#: ../../extending/newtypes_tutorial.rst:486
594
620
msgid ""
0 commit comments