11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2022 , Python Software Foundation
2+ # Copyright (C) 2001-2023 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
7- # Dai Xu <[email protected] >, 20228- # Freesand Leo <[email protected] >, 20227+ # Rafael Fontenelle <[email protected] >, 202398#
109#, fuzzy
1110msgid ""
1211msgstr ""
13- "Project-Id-Version : Python 3.10 \n "
12+ "Project-Id-Version : Python 3.11 \n "
1413"Report-Msgid-Bugs-To : \n "
15- "POT-Creation-Date : 2022-11-04 14:28 +0000\n "
16- "PO-Revision-Date : 2021-06-28 00:50 +0000\n "
17- "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2022 \n "
18- "Language-Team : Chinese (China) (https://www .transifex.com/python-doc/teams/5390/zh_CN/)\n "
14+ "POT-Creation-Date : 2023-09-29 14:44 +0000\n "
15+ "PO-Revision-Date : 2023-05-24 02:09 +0000\n "
16+ "Last-Translator : Rafael Fontenelle <rffontenelle@gmail .com>, 2023 \n "
17+ "Language-Team : Chinese (China) (https://app .transifex.com/python-doc/teams/5390/zh_CN/)\n "
1918"MIME-Version : 1.0\n "
2019"Content-Type : text/plain; charset=UTF-8\n "
2120"Content-Transfer-Encoding : 8bit\n "
@@ -60,31 +59,22 @@ msgstr "应用程序二进制接口的稳定版"
6059
6160#: ../../c-api/stable.rst:28
6261msgid ""
63- "Python 3.2 introduced the *Limited API*, a subset of Python's C API. "
64- "Extensions that only use the Limited API can be compiled once and work with "
65- "multiple versions of Python. Contents of the Limited API are :ref:`listed "
66- "below <stable-abi-list>`."
62+ "For simplicity, this document talks about *extensions*, but the Limited API "
63+ "and Stable ABI work the same way for all uses of the API – for example, "
64+ "embedding Python."
6765msgstr ""
68- "Python 3.2 引入了 *受限 API*,Python 的 C API 的一个子集。 只使用受限 API 的扩展可以被一次性编译而适用于多个 "
69- "Python 版本。 受限 API 的内容 :ref:`如下所示 <stable-abi-list>`。"
7066
71- #: ../../c-api/stable.rst:33
72- msgid ""
73- "To enable this, Python provides a *Stable ABI*: a set of symbols that will "
74- "remain compatible across Python 3.x versions. The Stable ABI contains "
75- "symbols exposed in the Limited API, but also other ones – for example, "
76- "functions necessary to support older versions of the Limited API."
67+ #: ../../c-api/stable.rst:35
68+ msgid "Limited C API"
7769msgstr ""
78- "为了实现这一点,Python 提供了一个 *稳定 ABI*: 一个将在各 Python 3.x 版本中保持兼容性的符号集合。 稳定 ABI 包含了在受限"
79- " API 中暴露的符号,但还包含其他符号 – 例如,支持旧版受限 API 所需的函数。"
8070
81- #: ../../c-api/stable.rst:38
71+ #: ../../c-api/stable.rst:37
8272msgid ""
83- "(For simplicity, this document talks about *extensions*, but the Limited API"
84- " and Stable ABI work the same way for all uses of the API – for example, "
85- "embedding Python.)"
73+ "Python 3.2 introduced the *Limited API*, a subset of Python's C API. "
74+ "Extensions that only use the Limited API can be compiled once and work with "
75+ "multiple versions of Python. Contents of the Limited API are :ref:`listed "
76+ "below <limited-api-list>`."
8677msgstr ""
87- "(简单起见,本文档只讨论了 *扩展*,但受限 API 和稳定 ABI 对于 API 的所有用法都同样适用 – 例如,嵌入 Python 等。)"
8878
8979#: ../../c-api/stable.rst:44
9080msgid ""
@@ -94,14 +84,14 @@ msgstr "请在包括 ``Python.h`` 之前定义这个宏以选择只使用受限
9484
9585#: ../../c-api/stable.rst:47
9686msgid ""
97- "Define ``Py_LIMITED_API`` to the value of :c:data :`PY_VERSION_HEX` "
87+ "Define ``Py_LIMITED_API`` to the value of :c:macro :`PY_VERSION_HEX` "
9888"corresponding to the lowest Python version your extension supports. The "
9989"extension will work without recompilation with all Python 3 releases from "
10090"the specified one onward, and can use Limited API introduced up to that "
10191"version."
10292msgstr ""
103- "将 ``Py_LIMITED_API`` 定义为对应你的扩展所支持的最低 Python 版本的 :c:data :`PY_VERSION_HEX` 的值。"
104- " 扩展无需重编译即可适用于从指定版本开始的所有 Python 3 发布版,并可使用到该版本为止所引入的受限 API。"
93+ "将 ``Py_LIMITED_API`` 定义为与你的扩展所支持的最低 Python 版本的 :c:macro :`PY_VERSION_HEX` 的值。"
94+ " 扩展将无需重编译即可适用于从该指定版本开始的所有 Python 3 发布版,并可使用到该版本为止所引入的受限 API。"
10595
10696#: ../../c-api/stable.rst:53
10797msgid ""
@@ -120,15 +110,32 @@ msgstr ""
120110"你还可以将 ``Py_LIMITED_API`` 定义为 ``3``。 其效果与 ``0x03020000`` 相同(即 Python 3.2,引入受限"
121111" API 的版本)。"
122112
123- #: ../../c-api/stable.rst:60
113+ #: ../../c-api/stable.rst:64
114+ msgid "Stable ABI"
115+ msgstr ""
116+
117+ #: ../../c-api/stable.rst:66
118+ msgid ""
119+ "To enable this, Python provides a *Stable ABI*: a set of symbols that will "
120+ "remain compatible across Python 3.x versions."
121+ msgstr ""
122+
123+ #: ../../c-api/stable.rst:69
124+ msgid ""
125+ "The Stable ABI contains symbols exposed in the :ref:`Limited API <limited-c-"
126+ "api>`, but also other ones – for example, functions necessary to support "
127+ "older versions of the Limited API."
128+ msgstr ""
129+
130+ #: ../../c-api/stable.rst:73
124131msgid ""
125132"On Windows, extensions that use the Stable ABI should be linked against "
126133"``python3.dll`` rather than a version-specific library such as "
127134"``python39.dll``."
128135msgstr ""
129136"在 Windows 上,使用稳定 ABI 的扩展应当被链接到 ``python3.dll`` 而不是版本专属的库如 ``python39.dll``。"
130137
131- #: ../../c-api/stable.rst:64
138+ #: ../../c-api/stable.rst:77
132139msgid ""
133140"On some platforms, Python will look for and load shared library files named "
134141"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such"
@@ -140,25 +147,25 @@ msgstr ""
140147"它不会检查这样的扩展是否兼容稳定 ABI。 使用方 (或其打包工具) 需要确保这一些,例如,基于 3.10+ 受限 API "
141148"编译的扩展不可被安装于更低版本的 Python 中。"
142149
143- #: ../../c-api/stable.rst:71
150+ #: ../../c-api/stable.rst:84
144151msgid ""
145152"All functions in the Stable ABI are present as functions in Python's shared "
146153"library, not solely as macros. This makes them usable from languages that "
147154"don't use the C preprocessor."
148155msgstr ""
149156"稳定 ABI 中的所有函数都会作为 Python 的共享库中的函数存在,而不仅是作为宏。 这使得它们可以在不使用 C 预处理器的语言中使用。"
150157
151- #: ../../c-api/stable.rst:77
158+ #: ../../c-api/stable.rst:90
152159msgid "Limited API Scope and Performance"
153160msgstr "受限 API 的作用域和性能"
154161
155- #: ../../c-api/stable.rst:79
162+ #: ../../c-api/stable.rst:92
156163msgid ""
157164"The goal for the Limited API is to allow everything that is possible with "
158165"the full C API, but possibly with a performance penalty."
159166msgstr "受限 API 的目标是允许使用在完整 C API 中可用的任何东西,但可能会有性能上的损失。"
160167
161- #: ../../c-api/stable.rst:82
168+ #: ../../c-api/stable.rst:95
162169msgid ""
163170"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro"
164171" variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because "
@@ -167,7 +174,7 @@ msgstr ""
167174"例如,虽然 :c:func:`PyList_GetItem` 是可用的,但其 “不安全的” 宏版本 :c:func:`PyList_GET_ITEM` "
168175"则是不可用的。 这个宏的运行速度更快因为它可以利用版本专属的列表对象实现细节。"
169176
170- #: ../../c-api/stable.rst:87
177+ #: ../../c-api/stable.rst:100
171178msgid ""
172179"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or "
173180"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, "
@@ -177,7 +184,7 @@ msgstr ""
177184"在未定义 ``Py_LIMITED_API`` 的情况下,某些 C API 函数将由宏来执行内联或替换。 定义 ``Py_LIMITED_API`` "
178185"会禁用这样的内联,允许提升 Python 的数据结构稳定性,但有可能降低性能。"
179186
180- #: ../../c-api/stable.rst:92
187+ #: ../../c-api/stable.rst:105
181188msgid ""
182189"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile "
183190"a Limited API extension with a version-specific ABI. This can improve "
@@ -190,21 +197,19 @@ msgstr ""
190197"版本上的性能,但也将限制其兼容性。 基于 ``Py_LIMITED_API`` 进行编译将产生一个可在版本专属扩展不可用的场合分发的扩展 – "
191198"例如,针对即将发布的 Python 版本的预发布包。"
192199
193- #: ../../c-api/stable.rst:101
200+ #: ../../c-api/stable.rst:114
194201msgid "Limited API Caveats"
195202msgstr "受限 API 警示"
196203
197- #: ../../c-api/stable.rst:103
204+ #: ../../c-api/stable.rst:116
198205msgid ""
199206"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee "
200- "that code conforms to the Limited API or the Stable ABI. ``Py_LIMITED_API`` "
201- "only covers definitions, but an API also includes other issues, such as "
202- "expected semantics."
207+ "that code conforms to the :ref:` Limited API <limited-c-api>` or the "
208+ ":ref:`Stable ABI <stable-abi>`. ``Py_LIMITED_API`` only covers definitions, "
209+ "but an API also includes other issues, such as expected semantics."
203210msgstr ""
204- "请注意基于 ``Py_LIMITED_API`` 进行编译 *不能* 完全保证代码兼容受限 API 或稳定 ABI。 "
205- "``Py_LIMITED_API`` 仅涵盖了定义,但是一个 API 还包括其他因素,例如预期的语义等。"
206211
207- #: ../../c-api/stable.rst:108
212+ #: ../../c-api/stable.rst:121
208213msgid ""
209214"One issue that ``Py_LIMITED_API`` does not guard against is calling a "
210215"function with arguments that are invalid in a lower Python version. For "
@@ -217,20 +222,20 @@ msgstr ""
217222" 作为参数的函数。 在 Python 3.9 中,``NULL`` 现在会选择一个默认行为,但在 Python 3.8 中,该参数将被直接使用,导致一个"
218223" ``NULL`` 引用被崩溃。 类似的参数也适用于结构体的字段。"
219224
220- #: ../../c-api/stable.rst:115
225+ #: ../../c-api/stable.rst:128
221226msgid ""
222227"Another issue is that some struct fields are currently not hidden when "
223228"``Py_LIMITED_API`` is defined, even though they're part of the Limited API."
224229msgstr "另一个问题是当定义了 ``Py_LIMITED_API`` 时某些结构体字段目前不会被隐藏,即使它们是受限 API 的一部分。"
225230
226- #: ../../c-api/stable.rst:118
231+ #: ../../c-api/stable.rst:131
227232msgid ""
228233"For these reasons, we recommend testing an extension with *all* minor Python"
229234" versions it supports, and preferably to build with the *lowest* such "
230235"version."
231236msgstr "出于这些原因,我们建议用要支持的 *所有* Python 小版本号来测试一个扩展,并最好是用其中 *最低* 的版本来编译它。"
232237
233- #: ../../c-api/stable.rst:121
238+ #: ../../c-api/stable.rst:134
234239msgid ""
235240"We also recommend reviewing documentation of all used API to check if it is "
236241"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a "
@@ -240,7 +245,7 @@ msgstr ""
240245"我们还建议查看所使用 API 的全部文档以检查其是否显式指明为受限 API 的一部分。 即使定义了 "
241246"``Py_LIMITED_API``,少数私有声明还是会出于技术原因(或者甚至是作为程序缺陷在无意中)被暴露出来。"
242247
243- #: ../../c-api/stable.rst:126
248+ #: ../../c-api/stable.rst:139
244249msgid ""
245250"Also note that the Limited API is not necessarily stable: compiling with "
246251"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with "
@@ -252,21 +257,19 @@ msgstr ""
252257"3.12 上运行,但它将不一定能用 Python 3.12 *编译*。 特别地,在稳定 ABI 保持稳定的情况下,部分受限 API "
253258"可能会被弃用并被移除。"
254259
255- #: ../../c-api/stable.rst:136
260+ #: ../../c-api/stable.rst:149
256261msgid "Platform Considerations"
257262msgstr "平台的考虑"
258263
259- #: ../../c-api/stable.rst:138
264+ #: ../../c-api/stable.rst:151
260265msgid ""
261266"ABI stability depends not only on Python, but also on the compiler used, "
262- "lower-level libraries and compiler options. For the purposes of the Stable "
263- "ABI, these details define a “platform”. They usually depend on the OS type "
264- "and processor architecture"
267+ "lower-level libraries and compiler options. For the purposes of the "
268+ ":ref:`Stable ABI <stable-abi>` , these details define a “platform”. They "
269+ "usually depend on the OS type and processor architecture"
265270msgstr ""
266- "ABI 的稳定性不仅取决于 Python,还取决于所使用的编译器、低层库和编译器选项。 对于稳定 ABI 的目标来说,这些细节定义了一个 “平台”。 "
267- "它们通常会取决于 OS 类型和处理器架构。"
268271
269- #: ../../c-api/stable.rst:143
272+ #: ../../c-api/stable.rst:156
270273msgid ""
271274"It is the responsibility of each particular distributor of Python to ensure "
272275"that all Python versions on a particular platform are built in a way that "
@@ -276,10 +279,12 @@ msgstr ""
276279"确保在特定平台上的所有 Python 版本都以不破坏稳定 ABI 的方式构建是每个特定 Python 分发方的责任。 来自 ``python.org``"
277280" 以及许多第三方分发商的 Windows 和 macOS 发布版都必于这种情况。"
278281
279- #: ../../c-api/stable.rst:153
282+ #: ../../c-api/stable.rst:166
280283msgid "Contents of Limited API"
281284msgstr "受限 API 的内容"
282285
283- #: ../../c-api/stable.rst:156
284- msgid "Currently, the Limited API includes the following items:"
285- msgstr "目前,受限 API 包括下面这些项:"
286+ #: ../../c-api/stable.rst:169
287+ msgid ""
288+ "Currently, the :ref:`Limited API <limited-c-api>` includes the following "
289+ "items:"
290+ msgstr ""
0 commit comments