Skip to content

Commit 5001545

Browse files
author
github-actions
committed
Merge 3.15 into 3.14
1 parent dfc54fc commit 5001545

51 files changed

Lines changed: 11448 additions & 3606 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎c-api/dict.po‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -827,17 +827,14 @@ msgstr ""
827827
msgid "``PyDict``"
828828
msgstr ""
829829

830-
#: ../../c-api/dict.rst:781
831830
msgid ":c:func:`PyDict_GetItem`"
832-
msgstr ""
831+
msgstr ":c:func:`PyDict_GetItem`"
833832

834-
#: ../../c-api/dict.rst:783
835833
msgid ":c:func:`PyDict_GetItemWithError`"
836-
msgstr ""
834+
msgstr ":c:func:`PyDict_GetItemWithError`"
837835

838-
#: ../../c-api/dict.rst:785
839836
msgid ":c:func:`PyDict_GetItemString`"
840-
msgstr ""
837+
msgstr ":c:func:`PyDict_GetItemString`"
841838

842839
#: ../../c-api/dict.rst:787
843840
msgid ":c:func:`PyDict_Contains`"

‎c-api/typeobj.po‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,9 +1317,8 @@ msgid ""
13171317
"the :c:member:`~PyVarObject.ob_size` field."
13181318
msgstr ""
13191319

1320-
#: ../../c-api/typeobj.rst:495
13211320
msgid ":c:member:`PyObject.ob_refcnt`"
1322-
msgstr ""
1321+
msgstr ":c:member:`PyObject.ob_refcnt`"
13231322

13241323
#: ../../c-api/typeobj.rst:497
13251324
msgid ""
@@ -1372,9 +1371,8 @@ msgstr "**継承:**"
13721371
msgid "This field is not inherited by subtypes."
13731372
msgstr "サブタイプはこのフィールドを継承しません。"
13741373

1375-
#: ../../c-api/typeobj.rst:509
13761374
msgid ":c:member:`PyObject.ob_type`"
1377-
msgstr ""
1375+
msgstr ":c:member:`PyObject.ob_type`"
13781376

13791377
#: ../../c-api/typeobj.rst:511
13801378
msgid ""
@@ -1420,9 +1418,8 @@ msgstr "サブタイプはこのフィールドを継承します。"
14201418
msgid "PyVarObject Slots"
14211419
msgstr "PyVarObject スロット"
14221420

1423-
#: ../../c-api/typeobj.rst:535
14241421
msgid ":c:member:`PyVarObject.ob_size`"
1425-
msgstr ""
1422+
msgstr ":c:member:`PyVarObject.ob_size`"
14261423

14271424
#: ../../c-api/typeobj.rst:537
14281425
msgid ""
@@ -4134,9 +4131,8 @@ msgid ""
41344131
"types must be compiled for a specific Python minor version."
41354132
msgstr ""
41364133

4137-
#: ../../c-api/typeobj.rst:2588
41384134
msgid "Heap Types"
4139-
msgstr ""
4135+
msgstr "ヒープ型"
41404136

41414137
#: ../../c-api/typeobj.rst:2590
41424138
msgid ""

‎faq/design.po‎

Lines changed: 77 additions & 66 deletions
Large diffs are not rendered by default.

‎faq/extending.po‎

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,32 @@ msgstr "ほとんどの中級から上級の Python 本もこの話題を扱っ
5151
msgid "Can I create my own functions in C++?"
5252
msgstr "C++ で独自の関数を作ることはできますか?"
5353

54-
#: ../../faq/extending.rst:28
5554
msgid ""
5655
"Yes, using the C compatibility features found in C++. Place ``extern "
5756
"\"C\" { ... }`` around the Python include files and put ``extern \"C\"`` "
5857
"before each function that is going to be called by the Python interpreter. "
5958
"Global or static C++ objects with constructors are probably not a good idea."
6059
msgstr ""
61-
"はい。C++ 内にある C 互換機能を使ってできます。 ``extern \"C\" { ... }`` で "
62-
"Python のインクルードファイルを囲み、 ``extern \"C\"`` を Python インタプリタ"
63-
"から呼ぶ各関数の前に置いてください。グローバルや静的な C++ オブジェクトの構造"
64-
"体を持つものは良くないでしょう。"
60+
"はい。\n"
61+
"C++ 内にある C 互換機能を使ってできます。\n"
62+
"``extern \"C\" { ... }`` で Python のインクルードファイルを囲み、 ``extern "
63+
"\"C\"`` を Python インタプリタから呼ぶ各関数の前に置いてください。\n"
64+
"コンストラクタを持つグローバルな C++ オブジェクトや静的な C++ オブジェクトを"
65+
"使うのは、おそらく望ましくありません。"
6566

6667
#: ../../faq/extending.rst:37
6768
msgid "Writing C is hard; are there any alternatives?"
6869
msgstr "C を書くのは大変です。他の方法はありませんか?"
6970

70-
#: ../../faq/extending.rst:39
7171
msgid ""
7272
"There are a number of alternatives to writing your own C extensions, "
7373
"depending on what you're trying to do. :ref:`Recommended third party tools "
7474
"<c-api-tools>` offer both simpler and more sophisticated approaches to "
7575
"creating C and C++ extensions for Python."
7676
msgstr ""
77+
"何をしたいかに応じて、C 拡張を自分で書く以外にもいくつかの方法があります。\n"
78+
":ref:`推奨されるサードパーティツール <c-api-tools>` には、Python の C/C++ 拡"
79+
"張をより簡単に作るものや、より高度な方法を提供するものがあります。"
7780

7881
#: ../../faq/extending.rst:46
7982
msgid "How can I execute arbitrary Python statements from C?"
@@ -185,22 +188,23 @@ msgstr ""
185188
"す。パラメタは、オブジェクト、呼び出すメソッドの名前、 :c:func:"
186189
"`Py_BuildValue` で使われるようなフォーマット文字列、そして引数です::"
187190

188-
#: ../../faq/extending.rst:102
189191
msgid ""
190192
"PyObject *\n"
191193
"PyObject_CallMethod(PyObject *object, const char *method_name,\n"
192194
" const char *arg_format, ...);"
193195
msgstr ""
196+
"PyObject *\n"
197+
"PyObject_CallMethod(PyObject *object, const char *method_name,\n"
198+
" const char *arg_format, ...);"
194199

195-
#: ../../faq/extending.rst:106
196200
msgid ""
197201
"This works for any object that has methods -- whether built-in or user-"
198202
"defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the "
199203
"return value."
200204
msgstr ""
201-
"これはメソッドを持ついかなるオブジェクトにも有効で、組み込みかユーザ定義かは"
202-
"関係ありません。返り値に対して :c:func:`Py_DECREF` する必要があることもありま"
203-
"す。"
205+
"これは、組み込みかユーザー定義かを問わず、メソッドを持つ任意のオブジェクトに"
206+
"使えます。\n"
207+
"返り値を使い終わったら、呼び出し側で :c:func:`Py_DECREF` する責任があります。"
204208

205209
#: ../../faq/extending.rst:109
206210
msgid ""
@@ -210,7 +214,6 @@ msgstr ""
210214
"例えば、あるファイルオブジェクトの \"seek\" メソッドを 10, 0 を引数として呼ぶ"
211215
"とき (ファイルオブジェクトのポインタを \"f\" とします)::"
212216

213-
#: ../../faq/extending.rst:112
214217
msgid ""
215218
"res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n"
216219
"if (res == NULL) {\n"
@@ -220,17 +223,24 @@ msgid ""
220223
" Py_DECREF(res);\n"
221224
"}"
222225
msgstr ""
226+
"res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n"
227+
"if (res == NULL) {\n"
228+
" ... 例外が発生した場合の処理 ...\n"
229+
"}\n"
230+
"else {\n"
231+
" Py_DECREF(res);\n"
232+
"}"
223233

224-
#: ../../faq/extending.rst:120
225234
msgid ""
226235
"Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the "
227236
"argument list, to call a function without arguments, pass \"()\" for the "
228237
"format, and to call a function with one argument, surround the argument in "
229238
"parentheses, e.g. \"(i)\"."
230239
msgstr ""
231240
"なお、 :c:func:`PyObject_CallObject` の引数リストには *常に* タプルが必要で"
232-
"す。関数を引数なしで呼び出すには、フォーマットに \"()\" を渡し、関数を一つの"
233-
"引数で呼び出すには、関数を括弧でくくって例えば \"(i)\" としてください。"
241+
"す。\n"
242+
"関数を引数なしで呼び出すには、フォーマットに \"()\" を渡し、関数を一つの引数"
243+
"で呼び出すには、引数の書式を括弧で囲んで例えば \"(i)\" としてください。"
234244

235245
#: ../../faq/extending.rst:127
236246
msgid ""
@@ -256,7 +266,6 @@ msgstr ""
256266
msgid "The easiest way to do this is to use the :class:`io.StringIO` class:"
257267
msgstr "最も簡単な方法は、 :class:`io.StringIO` クラスを使うことです:"
258268

259-
#: ../../faq/extending.rst:136
260269
msgid ""
261270
">>> import io, sys\n"
262271
">>> sys.stdout = io.StringIO()\n"
@@ -266,12 +275,18 @@ msgid ""
266275
"foo\n"
267276
"hello world!"
268277
msgstr ""
278+
">>> import io, sys\n"
279+
">>> sys.stdout = io.StringIO()\n"
280+
">>> print('foo')\n"
281+
">>> print('hello world!')\n"
282+
">>> sys.stderr.write(sys.stdout.getvalue())\n"
283+
"foo\n"
284+
"hello world!"
269285

270286
#: ../../faq/extending.rst:146
271287
msgid "A custom object to do the same would look like this:"
272288
msgstr "これと同じことをするカスタムオブジェクトは次のようになるでしょう:"
273289

274-
#: ../../faq/extending.rst:148
275290
msgid ""
276291
">>> import io, sys\n"
277292
">>> class StdoutCatcher(io.TextIOBase):\n"
@@ -288,6 +303,20 @@ msgid ""
288303
"foo\n"
289304
"hello world!"
290305
msgstr ""
306+
">>> import io, sys\n"
307+
">>> class StdoutCatcher(io.TextIOBase):\n"
308+
"... def __init__(self):\n"
309+
"... self.data = []\n"
310+
"... def write(self, stuff):\n"
311+
"... self.data.append(stuff)\n"
312+
"...\n"
313+
">>> import sys\n"
314+
">>> sys.stdout = StdoutCatcher()\n"
315+
">>> print('foo')\n"
316+
">>> print('hello world!')\n"
317+
">>> sys.stderr.write(''.join(sys.stdout.data))\n"
318+
"foo\n"
319+
"hello world!"
291320

292321
#: ../../faq/extending.rst:167
293322
msgid "How do I access a module written in Python from C?"
@@ -297,9 +326,8 @@ msgstr "C から Python で書かれたモジュールにアクセスするに
297326
msgid "You can get a pointer to the module object as follows::"
298327
msgstr "以下のようにモジュールオブジェクトへのポインタを得られます::"
299328

300-
#: ../../faq/extending.rst:171
301329
msgid "module = PyImport_ImportModule(\"<modulename>\");"
302-
msgstr ""
330+
msgstr "module = PyImport_ImportModule(\"<modulename>\");"
303331

304332
#: ../../faq/extending.rst:173
305333
msgid ""
@@ -323,9 +351,8 @@ msgstr ""
323351
"これで、モジュールの属性 (つまり、モジュールで定義された任意の名前) に以下の"
324352
"ようにアクセスできるようになります::"
325353

326-
#: ../../faq/extending.rst:182
327354
msgid "attr = PyObject_GetAttrString(module, \"<attrname>\");"
328-
msgstr ""
355+
msgstr "attr = PyObject_GetAttrString(module, \"<attrname>\");"
329356

330357
#: ../../faq/extending.rst:184
331358
msgid ""
@@ -379,13 +406,12 @@ msgstr ""
379406
msgid "How do I debug an extension?"
380407
msgstr "拡張をデバッグするにはどうしますか?"
381408

382-
#: ../../faq/extending.rst:211
383409
msgid ""
384410
"When using GDB with dynamically loaded extensions, you can't set a "
385411
"breakpoint in your extension until your extension is loaded."
386412
msgstr ""
387413
"動的にロードされた拡張に GDB を使うとき、拡張がロードされるまでブレークポイン"
388-
"トを設定してはいけません。"
414+
"トを設定できません。"
389415

390416
#: ../../faq/extending.rst:214
391417
msgid "In your ``.gdbinit`` file (or interactively), add the command:"
@@ -417,19 +443,20 @@ msgstr ""
417443
"Linux システムで Python モジュールをコンパイルしたいのですが、見つからない"
418444
"ファイルがあります。なぜですか?"
419445

420-
#: ../../faq/extending.rst:234
421446
msgid ""
422447
"Most packaged versions of Python omit some files required for compiling "
423448
"Python extensions."
424449
msgstr ""
450+
"パッケージとして配布されている Python の多くでは、Python 拡張のコンパイルに必"
451+
"要なファイルの一部が省かれています。"
425452

426-
#: ../../faq/extending.rst:237
427453
msgid "For Red Hat, install the python3-devel RPM to get the necessary files."
428454
msgstr ""
455+
"Red Hat では、必要なファイルを入手するために python3-devel RPM をインストール"
456+
"してください。"
429457

430-
#: ../../faq/extending.rst:239
431458
msgid "For Debian, run ``apt-get install python3-dev``."
432-
msgstr ""
459+
msgstr "Debian では ``apt-get install python3-dev`` を実行してください。"
433460

434461
#: ../../faq/extending.rst:242
435462
msgid "How do I tell \"incomplete input\" from \"invalid input\"?"

0 commit comments

Comments
 (0)