@@ -24,7 +24,7 @@ msgstr ""
2424
2525#: ../../c-api/stable.rst:7
2626msgid "C API Stability"
27- msgstr ""
27+ msgstr "C API の安定性 "
2828
2929#: ../../c-api/stable.rst:9
3030msgid ""
@@ -34,6 +34,11 @@ msgid ""
3434"API. Changing existing API or removing API is only done after a deprecation "
3535"period or to fix serious issues."
3636msgstr ""
37+ "Python の C API は、 Backwards Compatibility Policy, :pep:`387` によって保護"
38+ "されています。C API はマイナーリリースごとに変更されますが(例えば 3.9 から "
39+ "3.10 へ)、ほとんどの変更はソース互換であり、通常は新しい API を追加するだけで"
40+ "す。既存の API を変更したり、 API を削除したりするのは、非推奨期間の後か、深"
41+ "刻な問題を修正する場合のみです。"
3742
3843#: ../../c-api/stable.rst:15
3944msgid ""
@@ -43,12 +48,19 @@ msgid ""
4348"work on 3.10.8 and vice versa, but will need to be compiled separately for "
4449"3.9.x and 3.10.x."
4550msgstr ""
51+ "CPython の Application Binary Interface(ABI)は、マイナーリリース間で前方およ"
52+ "び後方互換性があります(これらが同じ方法でコンパイルされた場合。以下の :ref:"
53+ "`stable-abi-platform` を参照)。そのため、Python 3.10.0 用にコンパイルされた"
54+ "コードは 3.10.8 で動作し、その逆も同様ですが、 3.9.x と 3.10.x では別々にコン"
55+ "パイルする必要があります。"
4656
4757#: ../../c-api/stable.rst:21
4858msgid ""
4959"Names prefixed by an underscore, such as ``_Py_InternalState``, are private "
5060"API that can change without notice even in patch releases."
5161msgstr ""
62+ "``_Py_InternalState`` のようにアンダースコアが前につくものは、パッチリリース"
63+ "でも予告なく変更される可能性があるプライベートAPIです。"
5264
5365#: ../../c-api/stable.rst:26
5466msgid "Stable Application Binary Interface"
@@ -61,6 +73,10 @@ msgid ""
6173"multiple versions of Python. Contents of the Limited API are :ref:`listed "
6274"below <stable-abi-list>`."
6375msgstr ""
76+ "Python 3.2 では、 Python の C API のサブセットである *Limited API* が導入され"
77+ "ました。Limited API のみを使用する拡張機能は、一度コンパイルすれば、複数の"
78+ "バージョンの Python で動作させることができます。Limited API の内容は :ref:"
79+ "`listed below <stable-abi-list>` です。"
6480
6581#: ../../c-api/stable.rst:33
6682msgid ""
@@ -69,19 +85,28 @@ msgid ""
6985"symbols exposed in the Limited API, but also other ones – for example, "
7086"functions necessary to support older versions of the Limited API."
7187msgstr ""
88+ "これを可能にするために、 Python は *Stable ABI* を提供しています。これは、"
89+ "Python 3.x のバージョン間で互換性を保つシンボルの集合です。Stable ABI には、 "
90+ "Limited API で公開されているシンボルだけでなく、 Limited API の古いバージョン"
91+ "をサポートするために必要な関数など、他のシンボルも含まれています。"
7292
7393#: ../../c-api/stable.rst:38
7494msgid ""
7595"(For simplicity, this document talks about *extensions*, but the Limited API "
7696"and Stable ABI work the same way for all uses of the API – for example, "
7797"embedding Python.)"
7898msgstr ""
99+ "(簡単にするため、このドキュメントでは *拡張機能* について話していますが、 "
100+ "Limited API と Stable ABI は、 API のすべての使用、たとえばPythonの組み込みに"
101+ "対して同じように動作します)"
79102
80103#: ../../c-api/stable.rst:44
81104msgid ""
82105"Define this macro before including ``Python.h`` to opt in to only use the "
83106"Limited API, and to select the Limited API version."
84107msgstr ""
108+ "このマクロを ``Python.h`` をインクルードする前に定義することで、 Limited API "
109+ "のみを使用することを選択し、 Limited API バージョンを選択することができます。"
85110
86111#: ../../c-api/stable.rst:47
87112msgid ""
@@ -91,26 +116,39 @@ msgid ""
91116"the specified one onward, and can use Limited API introduced up to that "
92117"version."
93118msgstr ""
119+ "``Py_LIMITED_API`` を :c:data:`PY_VERSION_HEX` の値として定義し、拡張機能がサ"
120+ "ポートする Python の最低バージョンに対応します。この拡張機能は、指定された"
121+ "バージョン以降のすべての Python 3 リリースで再コンパイルせずに動作し、その"
122+ "バージョンまでに導入された Limited API を使用することができます。"
94123
95124#: ../../c-api/stable.rst:53
96125msgid ""
97126"Rather than using the ``PY_VERSION_HEX`` macro directly, hardcode a minimum "
98127"minor version (e.g. ``0x030A0000`` for Python 3.10) for stability when "
99128"compiling with future Python versions."
100129msgstr ""
130+ "``PY_VERSION_HEX`` マクロを直接使うのではなく、将来の Python のバージョンでコ"
131+ "ンパイルするときの安定性のために、最小のマイナーバージョン(例えば、 Python "
132+ "3.10なら ``0x030A0000`` )をハードコードします。"
101133
102134#: ../../c-api/stable.rst:57
103135msgid ""
104136"You can also define ``Py_LIMITED_API`` to ``3``. This works the same as "
105137"``0x03020000`` (Python 3.2, the version that introduced Limited API)."
106138msgstr ""
139+ "また、 ``Py_LIMITED_API`` を ``3`` に定義することができます。これは "
140+ "``0x03020000`` (Python 3.2, Limited API が導入されたバージョン)と同じように動"
141+ "作します。"
107142
108143#: ../../c-api/stable.rst:60
109144msgid ""
110145"On Windows, extensions that use the Stable ABI should be linked against "
111146"``python3.dll`` rather than a version-specific library such as ``python39."
112147"dll``."
113148msgstr ""
149+ "Windows では、 Stable ABI を使用する拡張機能は、 ``python39.dll`` のような"
150+ "バージョン固有のライブラリではなく、 ``python3.dll`` に対してリンクする必要が"
151+ "あります。"
114152
115153#: ../../c-api/stable.rst:64
116154msgid ""
@@ -120,30 +158,45 @@ msgid ""
120158"to ensure that, for example, extensions built with the 3.10+ Limited API are "
121159"not installed for lower versions of Python."
122160msgstr ""
161+ "いくつかのプラットフォームでは、 Python は ``abi3`` タグで名付けられた共有ラ"
162+ "イブラリファイルを探して読み込みます(例: ``mymodule.abi3.so``)。このような拡"
163+ "張モジュールが Stable ABI に適合しているかどうかはチェックされません。ユー"
164+ "ザー(またはそのパッケージングツール)は、たとえば 3.10+ Limited API でビルドさ"
165+ "れた拡張モジュールが、それ以下のバージョンの Python にインストールされないこ"
166+ "とを確認する必要があります。"
123167
124168#: ../../c-api/stable.rst:71
125169msgid ""
126170"All functions in the Stable ABI are present as functions in Python's shared "
127171"library, not solely as macros. This makes them usable from languages that "
128172"don't use the C preprocessor."
129173msgstr ""
174+ "Stable ABI に含まれるすべての関数は、マクロとしてだけでなく、 Python の共有ラ"
175+ "イブラリの関数として存在します。そのため、Cプリプロセッサを使用しない言語から"
176+ "使用することができます。"
130177
131178#: ../../c-api/stable.rst:77
132179msgid "Limited API Scope and Performance"
133- msgstr ""
180+ msgstr "APIスコープとパフォーマンスの制限 "
134181
135182#: ../../c-api/stable.rst:79
136183msgid ""
137184"The goal for the Limited API is to allow everything that is possible with "
138185"the full C API, but possibly with a performance penalty."
139186msgstr ""
187+ "Limited API の目標は、フル C API で可能なすべてのことを実現することですが、お"
188+ "そらく性能上の制約があります。"
140189
141190#: ../../c-api/stable.rst:82
142191msgid ""
143192"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro "
144193"variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it "
145194"can rely on version-specific implementation details of the list object."
146195msgstr ""
196+ "例えば、 :c:func:`PyList_GetItem` は利用可能ですが、その “unsafe” マクロの変"
197+ "種 :c:func:`PyList_GET_ITEM` は利用できません。このマクロは、リストオブジェク"
198+ "トのバージョン固有の実装の詳細に依存することができるため、より高速に処理する"
199+ "ことができます。"
147200
148201#: ../../c-api/stable.rst:87
149202msgid ""
@@ -152,6 +205,10 @@ msgid ""
152205"allowing stability as Python's data structures are improved, but possibly "
153206"reducing performance."
154207msgstr ""
208+ "``Py_LIMITED_API`` を定義しないと、いくつかの C API 関数がインライン化された"
209+ "り、マクロに置き換わったりします。``Py_LIMITED_API`` を定義すると、このインラ"
210+ "イン化が無効になり、 Python のデータ構造が改善されても安定した動作が可能にな"
211+ "りますが、性能が低下する可能性があります。"
155212
156213#: ../../c-api/stable.rst:92
157214msgid ""
@@ -162,10 +219,16 @@ msgid ""
162219"where a version-specific one is not available – for example, for prereleases "
163220"of an upcoming Python version."
164221msgstr ""
222+ "``Py_LIMITED_API`` の定義を省くことで、 Limited API 拡張をバージョン固有の "
223+ "ABI でコンパイルすることが可能です。これにより、その Python のバージョンでパ"
224+ "フォーマンスを向上させることができますが、互換性は制限されます。"
225+ "``Py_LIMITED_API`` でコンパイルすると、バージョンに依存しない拡張機能が利用で"
226+ "きない場合、例えば、次期 Python バージョンのプレリリースに対応した拡張モ"
227+ "ジュールを配布することができるようになります。"
165228
166229#: ../../c-api/stable.rst:101
167230msgid "Limited API Caveats"
168- msgstr ""
231+ msgstr "制限付きAPIの注意点 "
169232
170233#: ../../c-api/stable.rst:103
171234msgid ""
@@ -174,6 +237,10 @@ msgid ""
174237"only covers definitions, but an API also includes other issues, such as "
175238"expected semantics."
176239msgstr ""
240+ "``Py_LIMITED_API`` でコンパイルすることは、 Limited API や Stable ABI に準拠"
241+ "したコードであることを完全に保証するものではないことに注意してください。"
242+ "``Py_LIMITED_API`` は定義だけをカバーしていますが、 API には期待されるセマン"
243+ "ティクスのような他の課題も含まれています。"
177244
178245#: ../../c-api/stable.rst:108
179246msgid ""
@@ -184,18 +251,28 @@ msgid ""
184251"the argument will be used directly, causing a ``NULL`` dereference and "
185252"crash. A similar argument works for fields of structs."
186253msgstr ""
254+ "``Py_LIMITED_API`` が防げない問題の1つは、 Python の下位バージョンでは無効な"
255+ "引数を持つ関数を呼び出すことです。例えば、引数に ``NULL`` を受け取る関数を考"
256+ "えてみましょう。Python 3.9 では ``NULL`` はデフォルトの挙動を選択しますが、"
257+ "Python 3.8 ではこの引数は直接使用され、 ``NULL`` の参照外れを起こしクラッシュ"
258+ "します。同様の引数は、構造体のフィールドに対しても機能します。"
187259
188260#: ../../c-api/stable.rst:115
189261msgid ""
190262"Another issue is that some struct fields are currently not hidden when "
191263"``Py_LIMITED_API`` is defined, even though they're part of the Limited API."
192264msgstr ""
265+ "もう一つの問題は、一部の構造体フィールドがLimited APIの一部であるにもかかわら"
266+ "ず、 ``Py_LIMITED_API`` が定義されたときに現在非表示になっていないことです。"
193267
194268#: ../../c-api/stable.rst:118
195269msgid ""
196270"For these reasons, we recommend testing an extension with *all* minor Python "
197271"versions it supports, and preferably to build with the *lowest* such version."
198272msgstr ""
273+ "これらの理由から、私たちは拡張モジュールがサポートする *すべての* マイナーな "
274+ "Python バージョンでテストすること、そしてできれば *最も低い* バージョンでビル"
275+ "ドすることを推奨します。"
199276
200277#: ../../c-api/stable.rst:121
201278msgid ""
@@ -204,6 +281,10 @@ msgid ""
204281"few private declarations are exposed for technical reasons (or even "
205282"unintentionally, as bugs)."
206283msgstr ""
284+ "また、使用するすべての API のドキュメントを確認し、それが明示的に Limited "
285+ "API の一部であるかどうかをチェックすることをお勧めします。``Py_LIMITED_API`` "
286+ "が定義されていても、技術的な理由で(あるいはバグとして意図せず)いくつかのプラ"
287+ "イベート宣言が公開されることがあります。"
207288
208289#: ../../c-api/stable.rst:126
209290msgid ""
@@ -213,10 +294,14 @@ msgid ""
213294"particular, parts of the Limited API may be deprecated and removed, provided "
214295"that the Stable ABI stays stable."
215296msgstr ""
297+ "Python 3.8 で ``Py_LIMITED_API`` をコンパイルすると、その拡張モジュールは "
298+ "Python 3.12 で動作しますが、必ずしも Python 3.12 で *コンパイル* できるとは限"
299+ "らないことに注意してください。特に、Limited API の一部は、 Stable ABI が安定"
300+ "している限り、非推奨で削除されるかもしれません。"
216301
217302#: ../../c-api/stable.rst:136
218303msgid "Platform Considerations"
219- msgstr ""
304+ msgstr "プラットフォームで考慮すべき点 "
220305
221306#: ../../c-api/stable.rst:138
222307msgid ""
@@ -225,6 +310,10 @@ msgid ""
225310"ABI, these details define a “platform”. They usually depend on the OS type "
226311"and processor architecture"
227312msgstr ""
313+ "ABI の安定性は Python だけでなく、使用するコンパイラ、低レベルのライブラリ、"
314+ "コンパイラのオプションにも依存します。安定した ABI の目的では、これらの詳細が"
315+ "「プラットフォーム」を定義します。通常、 OS の種類とプロセッサのアーキテク"
316+ "チャに依存します。"
228317
229318#: ../../c-api/stable.rst:143
230319msgid ""
@@ -233,11 +322,15 @@ msgid ""
233322"does not break the Stable ABI. This is the case with Windows and macOS "
234323"releases from ``python.org`` and many third-party distributors."
235324msgstr ""
325+ "特定のプラットフォーム上のすべての Python バージョンが安定版 ABI を破壊しない"
326+ "方法でビルドされていることを保証するのは、 Python の各特定配布者の責任です。"
327+ "これは ``python.org`` や多くのサードパーティーの配布元からの Windows と "
328+ "macOS のリリースの場合です。"
236329
237330#: ../../c-api/stable.rst:153
238331msgid "Contents of Limited API"
239- msgstr ""
332+ msgstr "限定版APIの内容 "
240333
241334#: ../../c-api/stable.rst:156
242335msgid "Currently, the Limited API includes the following items:"
243- msgstr ""
336+ msgstr "現在、Limited APIには以下の項目が含まれています:: "
0 commit comments