@@ -12,7 +12,7 @@ msgid ""
1212msgstr ""
1313"Project-Id-Version : Python 3.13\n "
1414"Report-Msgid-Bugs-To : \n "
15- "POT-Creation-Date : 2024-10-04 14:17 +0000\n "
15+ "POT-Creation-Date : 2024-12-06 14:18 +0000\n "
1616"PO-Revision-Date : 2021-06-28 00:50+0000\n "
1717"Last-Translator : Freesand Leo <yuqinju@163.com>, 2024\n "
1818"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -130,12 +130,10 @@ msgstr "受限 C API"
130130#: ../../c-api/stable.rst:67
131131msgid ""
132132"Python 3.2 introduced the *Limited API*, a subset of Python's C API. "
133- "Extensions that only use the Limited API can be compiled once and work with "
134- "multiple versions of Python. Contents of the Limited API are :ref:`listed "
135- "below <limited-api-list>`."
133+ "Extensions that only use the Limited API can be compiled once and be loaded "
134+ "on multiple versions of Python. Contents of the Limited API are :ref:`listed"
135+ " below <limited-api-list>`."
136136msgstr ""
137- "Python 3.2 引入了 *受限 API*,它是 Python 的 C API 的一个子集。 只使用受限 API 扩展可以一次编译即适用于多个 "
138- "Python 版本。 受限 API 的内容 :ref:`如下所示 <limited-api-list>`。"
139137
140138#: ../../c-api/stable.rst:74
141139msgid ""
@@ -147,12 +145,9 @@ msgstr "请在包括 ``Python.h`` 之前定义这个宏以选择只使用受限
147145msgid ""
148146"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` "
149147"corresponding to the lowest Python version your extension supports. The "
150- "extension will work without recompilation with all Python 3 releases from "
151- "the specified one onward, and can use Limited API introduced up to that "
152- "version."
148+ "extension will be ABI-compatible with all Python 3 releases from the "
149+ "specified one onward, and can use Limited API introduced up to that version."
153150msgstr ""
154- "将 ``Py_LIMITED_API`` 定义为与你的扩展所支持的最低 Python 版本的 :c:macro:`PY_VERSION_HEX` 的值。"
155- " 扩展将无需重编译即可适用于从该指定版本开始的所有 Python 3 发布版,并可使用到该版本为止所引入的受限 API。"
156151
157152#: ../../c-api/stable.rst:83
158153msgid ""
@@ -178,10 +173,19 @@ msgstr "稳定 ABI"
178173#: ../../c-api/stable.rst:96
179174msgid ""
180175"To enable this, Python provides a *Stable ABI*: a set of symbols that will "
181- "remain compatible across Python 3.x versions."
182- msgstr "为启用此特性,Python 提供了一个 *稳定 ABI*: 将能跨 Python 3.x 版本保持兼容的一组符号。 "
176+ "remain ABI- compatible across Python 3.x versions."
177+ msgstr ""
183178
184- #: ../../c-api/stable.rst:99
179+ #: ../../c-api/stable.rst:101
180+ msgid ""
181+ "The Stable ABI prevents ABI issues, like linker errors due to missing "
182+ "symbols or data corruption due to changes in structure layouts or function "
183+ "signatures. However, other changes in Python can change the *behavior* of "
184+ "extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for "
185+ "details."
186+ msgstr ""
187+
188+ #: ../../c-api/stable.rst:107
185189msgid ""
186190"The Stable ABI contains symbols exposed in the :ref:`Limited API <limited-c-"
187191"api>`, but also other ones – for example, functions necessary to support "
@@ -190,15 +194,15 @@ msgstr ""
190194"稳定 ABI 包含在 :ref:`受限 API <limited-c-api>` 中对外公开的符号,但还包含其他符号 – 例如,为支持旧版本受限 API"
191195" 所需的函数。"
192196
193- #: ../../c-api/stable.rst:103
197+ #: ../../c-api/stable.rst:111
194198msgid ""
195199"On Windows, extensions that use the Stable ABI should be linked against "
196200"``python3.dll`` rather than a version-specific library such as "
197201"``python39.dll``."
198202msgstr ""
199203"在 Windows 上,使用稳定 ABI 的扩展应当被链接到 ``python3.dll`` 而不是版本专属的库如 ``python39.dll``。"
200204
201- #: ../../c-api/stable.rst:107
205+ #: ../../c-api/stable.rst:115
202206msgid ""
203207"On some platforms, Python will look for and load shared library files named "
204208"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such"
@@ -210,25 +214,25 @@ msgstr ""
210214"它不会检查这样的扩展是否兼容稳定 ABI。 使用方 (或其打包工具) 需要确保这一些,例如,基于 3.10+ 受限 API "
211215"编译的扩展不可被安装于更低版本的 Python 中。"
212216
213- #: ../../c-api/stable.rst:114
217+ #: ../../c-api/stable.rst:122
214218msgid ""
215219"All functions in the Stable ABI are present as functions in Python's shared "
216220"library, not solely as macros. This makes them usable from languages that "
217221"don't use the C preprocessor."
218222msgstr ""
219223"稳定 ABI 中的所有函数都会作为 Python 的共享库中的函数存在,而不仅是作为宏。 这使得它们可以在不使用 C 预处理器的语言中使用。"
220224
221- #: ../../c-api/stable.rst:120
225+ #: ../../c-api/stable.rst:128
222226msgid "Limited API Scope and Performance"
223227msgstr "受限 API 的作用域和性能"
224228
225- #: ../../c-api/stable.rst:122
229+ #: ../../c-api/stable.rst:130
226230msgid ""
227231"The goal for the Limited API is to allow everything that is possible with "
228232"the full C API, but possibly with a performance penalty."
229233msgstr "受限 API 的目标是允许使用在完整 C API 中可用的任何东西,但可能会有性能上的损失。"
230234
231- #: ../../c-api/stable.rst:125
235+ #: ../../c-api/stable.rst:133
232236msgid ""
233237"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro"
234238" variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because "
@@ -237,7 +241,7 @@ msgstr ""
237241"例如,虽然 :c:func:`PyList_GetItem` 是可用的,但其 “不安全的” 宏版本 :c:func:`PyList_GET_ITEM` "
238242"则是不可用的。 这个宏的运行速度更快因为它可以利用版本专属的列表对象实现细节。"
239243
240- #: ../../c-api/stable.rst:130
244+ #: ../../c-api/stable.rst:138
241245msgid ""
242246"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or "
243247"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, "
@@ -247,7 +251,7 @@ msgstr ""
247251"在未定义 ``Py_LIMITED_API`` 的情况下,某些 C API 函数将由宏来执行内联或替换。 定义 ``Py_LIMITED_API`` "
248252"会禁用这样的内联,允许提升 Python 的数据结构稳定性,但有可能降低性能。"
249253
250- #: ../../c-api/stable.rst:135
254+ #: ../../c-api/stable.rst:143
251255msgid ""
252256"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile "
253257"a Limited API extension with a version-specific ABI. This can improve "
@@ -260,11 +264,11 @@ msgstr ""
260264"版本上的性能,但也将限制其兼容性。 基于 ``Py_LIMITED_API`` 进行编译将产生一个可在版本专属扩展不可用的场合分发的扩展 – "
261265"例如,针对即将发布的 Python 版本的预发布包。"
262266
263- #: ../../c-api/stable.rst:144
267+ #: ../../c-api/stable.rst:152
264268msgid "Limited API Caveats"
265269msgstr "受限 API 警示"
266270
267- #: ../../c-api/stable.rst:146
271+ #: ../../c-api/stable.rst:154
268272msgid ""
269273"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee "
270274"that code conforms to the :ref:`Limited API <limited-c-api>` or the "
@@ -275,7 +279,7 @@ msgstr ""
275279"或 :ref:`稳定 ABI <stable-abi>`。 ``Py_LIMITED_API`` 仅仅涵盖定义部分,但一个 API "
276280"还包括其他因素,如预期的语义等。"
277281
278- #: ../../c-api/stable.rst:151
282+ #: ../../c-api/stable.rst:159
279283msgid ""
280284"One issue that ``Py_LIMITED_API`` does not guard against is calling a "
281285"function with arguments that are invalid in a lower Python version. For "
@@ -288,20 +292,20 @@ msgstr ""
288292" 作为参数的函数。 在 Python 3.9 中,``NULL`` 现在会选择一个默认行为,但在 Python 3.8 中,该参数将被直接使用,导致一个"
289293" ``NULL`` 引用被崩溃。 类似的参数也适用于结构体的字段。"
290294
291- #: ../../c-api/stable.rst:158
295+ #: ../../c-api/stable.rst:166
292296msgid ""
293297"Another issue is that some struct fields are currently not hidden when "
294298"``Py_LIMITED_API`` is defined, even though they're part of the Limited API."
295299msgstr "另一个问题是当定义了 ``Py_LIMITED_API`` 时某些结构体字段目前不会被隐藏,即使它们是受限 API 的一部分。"
296300
297- #: ../../c-api/stable.rst:161
301+ #: ../../c-api/stable.rst:169
298302msgid ""
299303"For these reasons, we recommend testing an extension with *all* minor Python"
300304" versions it supports, and preferably to build with the *lowest* such "
301305"version."
302306msgstr "出于这些原因,我们建议用要支持的 *所有* Python 小版本号来测试一个扩展,并最好是用其中 *最低* 的版本来编译它。"
303307
304- #: ../../c-api/stable.rst:164
308+ #: ../../c-api/stable.rst:172
305309msgid ""
306310"We also recommend reviewing documentation of all used API to check if it is "
307311"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a "
@@ -311,7 +315,7 @@ msgstr ""
311315"我们还建议查看所使用 API 的全部文档以检查其是否显式指明为受限 API 的一部分。 即使定义了 "
312316"``Py_LIMITED_API``,少数私有声明还是会出于技术原因(或者甚至是作为程序缺陷在无意中)被暴露出来。"
313317
314- #: ../../c-api/stable.rst:169
318+ #: ../../c-api/stable.rst:177
315319msgid ""
316320"Also note that the Limited API is not necessarily stable: compiling with "
317321"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with "
@@ -323,11 +327,11 @@ msgstr ""
323327"3.12 上运行,但它将不一定能用 Python 3.12 *编译*。 特别地,在稳定 ABI 保持稳定的情况下,部分受限 API "
324328"可能会被弃用并被移除。"
325329
326- #: ../../c-api/stable.rst:179
330+ #: ../../c-api/stable.rst:187
327331msgid "Platform Considerations"
328332msgstr "平台的考虑"
329333
330- #: ../../c-api/stable.rst:181
334+ #: ../../c-api/stable.rst:189
331335msgid ""
332336"ABI stability depends not only on Python, but also on the compiler used, "
333337"lower-level libraries and compiler options. For the purposes of the "
@@ -337,7 +341,7 @@ msgstr ""
337341"ABI 的稳定性不仅取决于 Python,取决于所使用的编译器、低层级库和编译器选项等。 对于 :ref:`稳定 ABI <stable-abi>` "
338342"的目标来说,这些细节定义了一个 “平台”。 它们通常会依赖于 OS 类型和处理器架构等。"
339343
340- #: ../../c-api/stable.rst:186
344+ #: ../../c-api/stable.rst:194
341345msgid ""
342346"It is the responsibility of each particular distributor of Python to ensure "
343347"that all Python versions on a particular platform are built in a way that "
@@ -347,11 +351,11 @@ msgstr ""
347351"确保在特定平台上的所有 Python 版本都以不破坏稳定 ABI 的方式构建是每个特定 Python 分发方的责任。 来自 ``python.org``"
348352" 以及许多第三方分发商的 Windows 和 macOS 发布版都必于这种情况。"
349353
350- #: ../../c-api/stable.rst:196
354+ #: ../../c-api/stable.rst:204
351355msgid "Contents of Limited API"
352356msgstr "受限 API 的内容"
353357
354- #: ../../c-api/stable.rst:199
358+ #: ../../c-api/stable.rst:207
355359msgid ""
356360"Currently, the :ref:`Limited API <limited-c-api>` includes the following "
357361"items:"
0 commit comments