-
-
Notifications
You must be signed in to change notification settings - Fork 214
/
Copy pathstable.po
395 lines (350 loc) · 17.8 KB
/
stable.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Matt Wang <[email protected]>, 2023
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-04 00:14+0000\n"
"PO-Revision-Date: 2023-01-24 21:07+0800\n"
"Last-Translator: Matt Wang <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.2.2\n"
#: ../../c-api/stable.rst:7
msgid "C API Stability"
msgstr "C API 穩定性"
#: ../../c-api/stable.rst:9
msgid ""
"Unless documented otherwise, Python's C API is covered by the Backwards "
"Compatibility Policy, :pep:`387`. Most changes to it are source-compatible "
"(typically by only adding new API). Changing existing API or removing API is "
"only done after a deprecation period or to fix serious issues."
msgstr ""
"除非有另外記錄於文件,Python 的 C API 被包含在向後相容性策略 :pep:`387` 中。"
"大多數改動都是相容於原始碼的(通常只會增加新的 API)。更改現有 API 或刪除 "
"API 僅在棄用期後或修復嚴重問題時進行。"
#: ../../c-api/stable.rst:15
msgid ""
"CPython's Application Binary Interface (ABI) is forward- and backwards-"
"compatible across a minor release (if these are compiled the same way; see :"
"ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will "
"work on 3.10.8 and vice versa, but will need to be compiled separately for "
"3.9.x and 3.11.x."
msgstr ""
"CPython 的應用程式二進位介面 (Application Binary Interface, ABI) 在次要版本中"
"是向前和向後相容的(如果它們以相同的方式編譯;請參閱下面的\\ :ref:`stable-"
"abi-platform`\\)。因此,為 Python 3.10.0 編譯的程式碼將能夠在 3.10.8 上運"
"行,反之亦然,但 3.9.x 和 3.11.x 就需要分別編譯。"
#: ../../c-api/stable.rst:21
msgid "There are two tiers of C API with different stability expectations:"
msgstr "C API 有兩層級,有不同的穩定性期望:"
#: ../../c-api/stable.rst:23
msgid ""
":ref:`Unstable API <unstable-c-api>`, may change in minor versions without a "
"deprecation period. It is marked by the ``PyUnstable`` prefix in names."
msgstr ""
":ref:`不穩定 API <unstable-c-api>`,可能會在次要版本中發生變化,而沒有棄用階"
"段。會在名稱中以 ``PyUnstable`` 前綴來標記。"
#: ../../c-api/stable.rst:25
msgid ""
":ref:`Limited API <limited-c-api>`, is compatible across several minor "
"releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is "
"exposed from ``Python.h``."
msgstr ""
":ref:`受限 API <limited-c-api>`,在多個次要版本之間相容。當有定義 :c:macro:"
"`Py_LIMITED_API` 時,只有這個子集會從 ``Python.h`` 公開。"
#: ../../c-api/stable.rst:29
msgid "These are discussed in more detail below."
msgstr "下面將更詳細地討論這些內容。"
#: ../../c-api/stable.rst:31
msgid ""
"Names prefixed by an underscore, such as ``_Py_InternalState``, are private "
"API that can change without notice even in patch releases. If you need to "
"use this API, consider reaching out to `CPython developers <https://discuss."
"python.org/c/core-dev/c-api/30>`_ to discuss adding public API for your use "
"case."
msgstr ""
"帶有底線前綴的名稱是私有 API (private API),像是 ``_Py_InternalState``,即使"
"在補丁版本 (patch release) 中也可能被更改,不會另行通知。如果你需要使用這個 "
"API,可以聯繫 `CPython 開發者 <https://discuss.python.org/c/core-dev/c-"
"api/30>`_ 並針對你的使用方法來討論是否新增公開的 API。"
#: ../../c-api/stable.rst:40
msgid "Unstable C API"
msgstr "不穩定的 C API"
#: ../../c-api/stable.rst:44
msgid ""
"Any API named with the ``PyUnstable`` prefix exposes CPython implementation "
"details, and may change in every minor release (e.g. from 3.9 to 3.10) "
"without any deprecation warnings. However, it will not change in a bugfix "
"release (e.g. from 3.10.0 to 3.10.1)."
msgstr ""
"任何以 ``PyUnstable`` 前綴命名的 API 都會公開 CPython 實作細節,並可能在每個"
"次要版本中進行更改(例如從 3.9 到 3.10),而不會出現任何棄用警告。但是它不會"
"在錯誤修復發布版本中發生變化(例如從 3.10.0 到 3.10.1)。"
#: ../../c-api/stable.rst:49
msgid ""
"It is generally intended for specialized, low-level tools like debuggers."
msgstr "它通常用於專門的低階工具,例如偵錯器。"
#: ../../c-api/stable.rst:51
msgid ""
"Projects that use this API are expected to follow CPython development and "
"spend extra effort adjusting to changes."
msgstr ""
"使用此 API 的專案應該要遵循 CPython 開發細節,並花費額外的力氣來針對這些變動"
"來做調整。"
#: ../../c-api/stable.rst:56
msgid "Stable Application Binary Interface"
msgstr "穩定的應用程式二進位介面"
#: ../../c-api/stable.rst:58
msgid ""
"For simplicity, this document talks about *extensions*, but the Limited API "
"and Stable ABI work the same way for all uses of the API – for example, "
"embedding Python."
msgstr ""
"為簡單起見,本文件討論\\ *擴充 (extension)*,但受限 API 和穩定 ABI 在所有 "
"API 使用方式中都以相同的方式運作 -- 例如在嵌入式 Python (embedding Python) "
"中。"
#: ../../c-api/stable.rst:65
msgid "Limited C API"
msgstr "受限 C API"
#: ../../c-api/stable.rst:67
msgid ""
"Python 3.2 introduced the *Limited API*, a subset of Python's C API. "
"Extensions that only use the Limited API can be compiled once and be loaded "
"on multiple versions of Python. Contents of the Limited API are :ref:`listed "
"below <limited-api-list>`."
msgstr ""
"Python 3.2 引入了\\ *受限 API (Limited API)*,它是 Python C API 的一個子集。"
"僅使用受限 API 的擴充可以只編譯一次就被載入於多個版本的 Python。受限 API 的內"
"容\\ :ref:`列在下方 <limited-api-list>`。"
#: ../../c-api/stable.rst:74
msgid ""
"Define this macro before including ``Python.h`` to opt in to only use the "
"Limited API, and to select the Limited API version."
msgstr ""
"在包含 ``Python.h`` 之前定義此巨集以選擇只使用受限 API,並挑選受限 API 版本。"
#: ../../c-api/stable.rst:77
msgid ""
"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` "
"corresponding to the lowest Python version your extension supports. The "
"extension will be ABI-compatible with all Python 3 releases from the "
"specified one onward, and can use Limited API introduced up to that version."
msgstr ""
"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:"
"macro:`PY_VERSION_HEX` 值。該擴充與從指定版本開始的所有 Python 3 版本之 ABI "
"相容,並且可以使用過去版本有引入的受限 API。"
#: ../../c-api/stable.rst:83
msgid ""
"Rather than using the ``PY_VERSION_HEX`` macro directly, hardcode a minimum "
"minor version (e.g. ``0x030A0000`` for Python 3.10) for stability when "
"compiling with future Python versions."
msgstr ""
"與其直接使用 ``PY_VERSION_HEX`` 巨集,不如寫死 (hardcode) 最小次要版本(例如"
"代表 Python 3.10 的 ``0x030A0000``\\ ),以便在使用未來的 Python 版本進行編譯"
"時仍保持穩定性。"
#: ../../c-api/stable.rst:87
msgid ""
"You can also define ``Py_LIMITED_API`` to ``3``. This works the same as "
"``0x03020000`` (Python 3.2, the version that introduced Limited API)."
msgstr ""
"你還可以將 ``Py_LIMITED_API`` 定義為 ``3``,這與 ``0x03020000``\\ (Python "
"3.2,引入了受限 API 的版本)相同。"
#: ../../c-api/stable.rst:94
msgid "Stable ABI"
msgstr "穩定 ABI"
#: ../../c-api/stable.rst:96
msgid ""
"To enable this, Python provides a *Stable ABI*: a set of symbols that will "
"remain ABI-compatible across Python 3.x versions."
msgstr ""
"為了實現它,Python 提供了一個\\ *穩定 ABI (Stable ABI)*:一組將在各個 Python "
"3.x 版本之間保持 ABI 相容的符號。"
#: ../../c-api/stable.rst:101
msgid ""
"The Stable ABI prevents ABI issues, like linker errors due to missing "
"symbols or data corruption due to changes in structure layouts or function "
"signatures. However, other changes in Python can change the *behavior* of "
"extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for "
"details."
msgstr ""
#: ../../c-api/stable.rst:107
msgid ""
"The Stable ABI contains symbols exposed in the :ref:`Limited API <limited-c-"
"api>`, but also other ones – for example, functions necessary to support "
"older versions of the Limited API."
msgstr ""
"穩定 ABI 被包含在\\ :ref:`受限 API <limited-c-api>` 中開放的符號,但也包含其"
"他符號 - 例如,支援舊版受限 API 所必需的函式。"
#: ../../c-api/stable.rst:111
msgid ""
"On Windows, extensions that use the Stable ABI should be linked against "
"``python3.dll`` rather than a version-specific library such as ``python39."
"dll``."
msgstr ""
"在 Windows 上,使用穩定 ABI 的擴充應該連接到 ``python3.dll`` 而不是特定版本的"
"函式庫,例如 ``python39.dll``。"
#: ../../c-api/stable.rst:115
msgid ""
"On some platforms, Python will look for and load shared library files named "
"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such "
"extensions conform to a Stable ABI. The user (or their packaging tools) need "
"to ensure that, for example, extensions built with the 3.10+ Limited API are "
"not installed for lower versions of Python."
msgstr ""
"在某些平台上,Python 將查找並加載以 ``abi3`` 標籤命名的共享函式庫檔案(例如 "
"``mymodule.abi3.so``\\ )。它不檢查此類擴充是否符合穩定的 ABI。確保的責任在使"
"用者(或者打包工具)身上,例如使用 3.10+ 受限 API 建置的擴充不會為較低版本的 "
"Python 所安裝。"
#: ../../c-api/stable.rst:122
msgid ""
"All functions in the Stable ABI are present as functions in Python's shared "
"library, not solely as macros. This makes them usable from languages that "
"don't use the C preprocessor."
msgstr ""
"穩定 ABI 中的所有函式都作為函式存在於 Python 的共享函式庫中,而不僅是作為巨"
"集。這使得它們可被用於不使用 C 預處理器 (preprocessor) 的語言。"
#: ../../c-api/stable.rst:128
msgid "Limited API Scope and Performance"
msgstr "受限 API 範圍和性能"
#: ../../c-api/stable.rst:130
msgid ""
"The goal for the Limited API is to allow everything that is possible with "
"the full C API, but possibly with a performance penalty."
msgstr ""
"受限 API 的目標是允許使用完整的 C API 進行所有可能的操作,但可能會降低性能。"
#: ../../c-api/stable.rst:133
msgid ""
"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro "
"variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it "
"can rely on version-specific implementation details of the list object."
msgstr ""
"例如,雖然 :c:func:`PyList_GetItem` 可用,但它的「不安全」巨集變體 :c:func:"
"`PyList_GET_ITEM` 為不可用。巨集運行可以更快,因為它可以依賴 list 物件的特定"
"版本實作細節。"
#: ../../c-api/stable.rst:138
msgid ""
"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or "
"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, "
"allowing stability as Python's data structures are improved, but possibly "
"reducing performance."
msgstr ""
"如果沒有定義 ``Py_LIMITED_API``,一些 C API 函式將被嵌入或被替換為巨集。定義 "
"``Py_LIMITED_API`` 會禁用嵌入,從而隨著 Python 資料結構的改進而提高穩定性,但"
"可能會降低性能。"
#: ../../c-api/stable.rst:143
msgid ""
"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile "
"a Limited API extension with a version-specific ABI. This can improve "
"performance for that Python version, but will limit compatibility. Compiling "
"with ``Py_LIMITED_API`` will then yield an extension that can be distributed "
"where a version-specific one is not available – for example, for prereleases "
"of an upcoming Python version."
msgstr ""
"通過省略 ``Py_LIMITED_API`` 定義,可以使用特定版本的 ABI 編譯受限 API 擴充。"
"這可以提高該 Python 版本的性能,但會限制相容性。使用 ``Py_LIMITED_API`` 編譯"
"將產生一個擴充,可以在特定版本的擴充不可用的地方發布 — 例如,用於即將發布的 "
"Python 版本的預發布版本 (prerelease)。"
#: ../../c-api/stable.rst:152
msgid "Limited API Caveats"
msgstr "受限 API 注意事項"
#: ../../c-api/stable.rst:154
msgid ""
"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee "
"that code conforms to the :ref:`Limited API <limited-c-api>` or the :ref:"
"`Stable ABI <stable-abi>`. ``Py_LIMITED_API`` only covers definitions, but "
"an API also includes other issues, such as expected semantics."
msgstr ""
"請注意,使用 ``Py_LIMITED_API`` 進行編譯\\ *不*\\ 完全保證程式碼符合\\ :ref:`"
"受限 API <limited-c-api>` 或\\ :ref:`穩定 ABI <stable-abi>`。"
"``Py_LIMITED_API`` 僅涵蓋定義,但 API 還包括其他議題,例如預期的語義 "
"(semantic)。"
#: ../../c-api/stable.rst:159
msgid ""
"One issue that ``Py_LIMITED_API`` does not guard against is calling a "
"function with arguments that are invalid in a lower Python version. For "
"example, consider a function that starts accepting ``NULL`` for an argument. "
"In Python 3.9, ``NULL`` now selects a default behavior, but in Python 3.8, "
"the argument will be used directly, causing a ``NULL`` dereference and "
"crash. A similar argument works for fields of structs."
msgstr ""
"``Py_LIMITED_API`` 無法防範的一個問題是使用在較低 Python 版本中無效的引數來呼"
"叫函式。例如一個開始接受 ``NULL`` 作為引數的函式。在 Python 3.9 中,``NULL`` "
"現在代表選擇預設行為,但在 Python 3.8 中,引數將被直接使用,導致 ``NULL`` 取"
"消參照 (dereference) 且崩潰 (crash)。類似的引數適用於結構 (struct) 的欄位。"
#: ../../c-api/stable.rst:166
msgid ""
"Another issue is that some struct fields are currently not hidden when "
"``Py_LIMITED_API`` is defined, even though they're part of the Limited API."
msgstr ""
"另一個問題是,當有定義 ``Py_LIMITED_API`` 時,一些結構欄位目前不會被隱藏,即"
"使它們是受限 API 的一部分。"
#: ../../c-api/stable.rst:169
msgid ""
"For these reasons, we recommend testing an extension with *all* minor Python "
"versions it supports, and preferably to build with the *lowest* such version."
msgstr ""
"出於這些原因,我們建議要以它支援的\\ *所有*\\ 次要 Python 版本來測試擴充,並"
"且最好使用\\ *最低*\\ 版本進行建置。"
#: ../../c-api/stable.rst:172
msgid ""
"We also recommend reviewing documentation of all used API to check if it is "
"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a "
"few private declarations are exposed for technical reasons (or even "
"unintentionally, as bugs)."
msgstr ""
"我們也建議要查看所有使用過的 API 的文件,檢查它是否明確屬於受限 API。即使有定"
"義 ``Py_LIMITED_API``,一些私有聲明也會因為技術原因(或者甚至是無意地,例如臭"
"蟲)而被公開出來。"
#: ../../c-api/stable.rst:177
msgid ""
"Also note that the Limited API is not necessarily stable: compiling with "
"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with "
"Python 3.12, but it will not necessarily *compile* with Python 3.12. In "
"particular, parts of the Limited API may be deprecated and removed, provided "
"that the Stable ABI stays stable."
msgstr ""
"另請注意,受限 API 不一定是穩定的:在 Python 3.8 中使用 ``Py_LIMITED_API`` 進"
"行編譯意味著擴充將能以 Python 3.12 運行,但不一定能以 Python 3.12 *編譯*。特"
"別是如果穩定 ABI 保持穩定,部分受限 API 可能會被棄用和刪除。"
#: ../../c-api/stable.rst:187
msgid "Platform Considerations"
msgstr "平台注意事項"
#: ../../c-api/stable.rst:189
msgid ""
"ABI stability depends not only on Python, but also on the compiler used, "
"lower-level libraries and compiler options. For the purposes of the :ref:"
"`Stable ABI <stable-abi>`, these details define a “platform”. They usually "
"depend on the OS type and processor architecture"
msgstr ""
"ABI 穩定性不僅取決於 Python,還取決於使用的編譯器、低階函式庫和編譯器選項。出"
"於\\ :ref:`穩定 ABI <stable-abi>` 的目的,這些細節定義了一個「平台」。它們通"
"常取決於作業系統種類和處理器架構"
#: ../../c-api/stable.rst:194
msgid ""
"It is the responsibility of each particular distributor of Python to ensure "
"that all Python versions on a particular platform are built in a way that "
"does not break the Stable ABI. This is the case with Windows and macOS "
"releases from ``python.org`` and many third-party distributors."
msgstr ""
"每個特定的 Python 發布者都有責任確保特定平台上的所有 Python 版本都以不破壞穩"
"定 ABI 的方式建置。``python.org`` 和許多第三方發布者發布的 Windows 和 macOS "
"版本就是這種情況。"
#: ../../c-api/stable.rst:204
msgid "Contents of Limited API"
msgstr "受限 API 的內容"
#: ../../c-api/stable.rst:207
msgid ""
"Currently, the :ref:`Limited API <limited-c-api>` includes the following "
"items:"
msgstr "目前,:ref:`受限 API <limited-c-api>` 包括以下項目:"
#: ../../c-api/stable.rst:42
msgid "PyUnstable"
msgstr "PyUnstable"