@@ -126,6 +126,7 @@ msgid ""
126126"``python3.dll`` rather than a version-specific library such as "
127127"``python39.dll``."
128128msgstr ""
129+ "在 Windows 上,使用稳定 ABI 的扩展应当被链接到 ``python3.dll`` 而不是版本专属的库如 ``python39.dll``。"
129130
130131#: ../../c-api/stable.rst:64
131132msgid ""
@@ -135,30 +136,36 @@ msgid ""
135136"need to ensure that, for example, extensions built with the 3.10+ Limited "
136137"API are not installed for lower versions of Python."
137138msgstr ""
139+ "在某些平台上,Python 将查找并载入名称中带有 ``abi3`` 标签的共享库文件 (例如 ``mymodule.abi3.so``)。 "
140+ "它不会检查这样的扩展是否兼容稳定 ABI。 使用方 (或其打包工具) 需要确保这一些,例如,基于 3.10+ 受限 API "
141+ "编译的扩展不可被安装于更低版本的 Python 中。"
138142
139143#: ../../c-api/stable.rst:71
140144msgid ""
141145"All functions in the Stable ABI are present as functions in Python's shared "
142146"library, not solely as macros. This makes them usable from languages that "
143147"don't use the C preprocessor."
144148msgstr ""
149+ "稳定 ABI 中的所有函数都会作为 Python 的共享库中的函数存在,而不仅是作为宏。 这使得它们可以在不使用 C 预处理器的语言中使用。"
145150
146151#: ../../c-api/stable.rst:77
147152msgid "Limited API Scope and Performance"
148- msgstr ""
153+ msgstr "受限 API 的作用域和性能 "
149154
150155#: ../../c-api/stable.rst:79
151156msgid ""
152157"The goal for the Limited API is to allow everything that is possible with "
153158"the full C API, but possibly with a performance penalty."
154- msgstr ""
159+ msgstr "受限 API 的目标是允许使用在完整 C API 中可用的任何东西,但可能会有性能上的损失。 "
155160
156161#: ../../c-api/stable.rst:82
157162msgid ""
158163"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro"
159164" variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because "
160165"it can rely on version-specific implementation details of the list object."
161166msgstr ""
167+ "例如,虽然 :c:func:`PyList_GetItem` 是可用的,但其 “不安全的” 宏版本 :c:func:`PyList_GET_ITEM` "
168+ "则是不可用的。 这个宏的运行速度更快因为它可以利用版本专属的列表对象实现细节。"
162169
163170#: ../../c-api/stable.rst:87
164171msgid ""
@@ -167,6 +174,8 @@ msgid ""
167174"allowing stability as Python's data structures are improved, but possibly "
168175"reducing performance."
169176msgstr ""
177+ "在未定义 ``Py_LIMITED_API`` 的情况下,某些 C API 函数将由宏来执行内联或替换。 定义 ``Py_LIMITED_API`` "
178+ "会禁用这样的内联,允许提升 Python 的数据结构稳定性,但有可能降低性能。"
170179
171180#: ../../c-api/stable.rst:92
172181msgid ""
@@ -177,10 +186,13 @@ msgid ""
177186"distributed where a version-specific one is not available – for example, for"
178187" prereleases of an upcoming Python version."
179188msgstr ""
189+ "通过省略 ``Py_LIMITED_API`` 定义,可以使基于版本专属的 ABI 来编译受限 API 扩展成为可能。 这能提升其在相应 Python "
190+ "版本上的性能,但也将限制其兼容性。 基于 ``Py_LIMITED_API`` 进行编译将产生一个可在版本专属扩展不可用的场合分发的扩展 – "
191+ "例如,针对即将发布的 Python 版本的预发布包。"
180192
181193#: ../../c-api/stable.rst:101
182194msgid "Limited API Caveats"
183- msgstr ""
195+ msgstr "受限 API 警示 "
184196
185197#: ../../c-api/stable.rst:103
186198msgid ""
@@ -189,6 +201,8 @@ msgid ""
189201"only covers definitions, but an API also includes other issues, such as "
190202"expected semantics."
191203msgstr ""
204+ "请注意基于 ``Py_LIMITED_API`` 进行编译 *不能* 完全保证代码兼容受限 API 或稳定 ABI。 "
205+ "``Py_LIMITED_API`` 仅涵盖了定义,但是一个 API 还包括其他因素,例如预期的语义等。"
192206
193207#: ../../c-api/stable.rst:108
194208msgid ""
0 commit comments