4
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
#
6
6
# Translators:
7
- # Dai Xu <[email protected] >, 2022
8
- # Freesand Leo <[email protected] >, 2024
7
+ # Rafael Fontenelle <[email protected] >, 2024
9
8
#
10
9
#, fuzzy
11
10
msgid ""
12
11
msgstr ""
13
12
"Project-Id-Version : Python 3.12\n "
14
13
"Report-Msgid-Bugs-To : \n "
15
- "POT-Creation-Date : 2024-01-19 14:14 +0000\n "
16
- "PO-Revision-Date : 2021-06-28 00:50 +0000\n "
17
- "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2024\n "
14
+ "POT-Creation-Date : 2024-12-06 14:52 +0000\n "
15
+ "PO-Revision-Date : 2024-05-11 00:32 +0000\n "
16
+ "Last-Translator : Rafael Fontenelle <rffontenelle@gmail .com>, 2024\n "
18
17
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
19
18
"MIME-Version : 1.0\n "
20
19
"Content-Type : text/plain; charset=UTF-8\n "
@@ -130,12 +129,10 @@ msgstr "受限 C API"
130
129
#: ../../c-api/stable.rst:67
131
130
msgid ""
132
131
"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>`."
132
+ "Extensions that only use the Limited API can be compiled once and be loaded "
133
+ "on multiple versions of Python. Contents of the Limited API are :ref:`listed"
134
+ " below <limited-api-list>`."
136
135
msgstr ""
137
- "Python 3.2 引入了 *受限 API*,它是 Python 的 C API 的一个子集。 只使用受限 API 扩展可以一次编译即适用于多个 "
138
- "Python 版本。 受限 API 的内容 :ref:`如下所示 <limited-api-list>`。"
139
136
140
137
#: ../../c-api/stable.rst:74
141
138
msgid ""
@@ -147,12 +144,9 @@ msgstr "请在包括 ``Python.h`` 之前定义这个宏以选择只使用受限
147
144
msgid ""
148
145
"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` "
149
146
"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."
147
+ "extension will be ABI-compatible with all Python 3 releases from the "
148
+ "specified one onward, and can use Limited API introduced up to that version."
153
149
msgstr ""
154
- "将 ``Py_LIMITED_API`` 定义为与你的扩展所支持的最低 Python 版本的 :c:macro:`PY_VERSION_HEX` 的值。"
155
- " 扩展将无需重编译即可适用于从该指定版本开始的所有 Python 3 发布版,并可使用到该版本为止所引入的受限 API。"
156
150
157
151
#: ../../c-api/stable.rst:83
158
152
msgid ""
@@ -178,10 +172,19 @@ msgstr "稳定 ABI"
178
172
#: ../../c-api/stable.rst:96
179
173
msgid ""
180
174
"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 版本保持兼容的一组符号。 "
175
+ "remain ABI- compatible across Python 3.x versions."
176
+ msgstr ""
183
177
184
- #: ../../c-api/stable.rst:99
178
+ #: ../../c-api/stable.rst:101
179
+ msgid ""
180
+ "The Stable ABI prevents ABI issues, like linker errors due to missing "
181
+ "symbols or data corruption due to changes in structure layouts or function "
182
+ "signatures. However, other changes in Python can change the *behavior* of "
183
+ "extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for "
184
+ "details."
185
+ msgstr ""
186
+
187
+ #: ../../c-api/stable.rst:107
185
188
msgid ""
186
189
"The Stable ABI contains symbols exposed in the :ref:`Limited API <limited-c-"
187
190
"api>`, but also other ones – for example, functions necessary to support "
@@ -190,15 +193,15 @@ msgstr ""
190
193
"稳定 ABI 包含在 :ref:`受限 API <limited-c-api>` 中对外公开的符号,但还包含其他符号 – 例如,为支持旧版本受限 API"
191
194
" 所需的函数。"
192
195
193
- #: ../../c-api/stable.rst:103
196
+ #: ../../c-api/stable.rst:111
194
197
msgid ""
195
198
"On Windows, extensions that use the Stable ABI should be linked against "
196
199
"``python3.dll`` rather than a version-specific library such as "
197
200
"``python39.dll``."
198
201
msgstr ""
199
202
"在 Windows 上,使用稳定 ABI 的扩展应当被链接到 ``python3.dll`` 而不是版本专属的库如 ``python39.dll``。"
200
203
201
- #: ../../c-api/stable.rst:107
204
+ #: ../../c-api/stable.rst:115
202
205
msgid ""
203
206
"On some platforms, Python will look for and load shared library files named "
204
207
"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such"
@@ -210,25 +213,25 @@ msgstr ""
210
213
"它不会检查这样的扩展是否兼容稳定 ABI。 使用方 (或其打包工具) 需要确保这一些,例如,基于 3.10+ 受限 API "
211
214
"编译的扩展不可被安装于更低版本的 Python 中。"
212
215
213
- #: ../../c-api/stable.rst:114
216
+ #: ../../c-api/stable.rst:122
214
217
msgid ""
215
218
"All functions in the Stable ABI are present as functions in Python's shared "
216
219
"library, not solely as macros. This makes them usable from languages that "
217
220
"don't use the C preprocessor."
218
221
msgstr ""
219
222
"稳定 ABI 中的所有函数都会作为 Python 的共享库中的函数存在,而不仅是作为宏。 这使得它们可以在不使用 C 预处理器的语言中使用。"
220
223
221
- #: ../../c-api/stable.rst:120
224
+ #: ../../c-api/stable.rst:128
222
225
msgid "Limited API Scope and Performance"
223
226
msgstr "受限 API 的作用域和性能"
224
227
225
- #: ../../c-api/stable.rst:122
228
+ #: ../../c-api/stable.rst:130
226
229
msgid ""
227
230
"The goal for the Limited API is to allow everything that is possible with "
228
231
"the full C API, but possibly with a performance penalty."
229
232
msgstr "受限 API 的目标是允许使用在完整 C API 中可用的任何东西,但可能会有性能上的损失。"
230
233
231
- #: ../../c-api/stable.rst:125
234
+ #: ../../c-api/stable.rst:133
232
235
msgid ""
233
236
"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro"
234
237
" variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because "
@@ -237,7 +240,7 @@ msgstr ""
237
240
"例如,虽然 :c:func:`PyList_GetItem` 是可用的,但其 “不安全的” 宏版本 :c:func:`PyList_GET_ITEM` "
238
241
"则是不可用的。 这个宏的运行速度更快因为它可以利用版本专属的列表对象实现细节。"
239
242
240
- #: ../../c-api/stable.rst:130
243
+ #: ../../c-api/stable.rst:138
241
244
msgid ""
242
245
"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or "
243
246
"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, "
@@ -247,7 +250,7 @@ msgstr ""
247
250
"在未定义 ``Py_LIMITED_API`` 的情况下,某些 C API 函数将由宏来执行内联或替换。 定义 ``Py_LIMITED_API`` "
248
251
"会禁用这样的内联,允许提升 Python 的数据结构稳定性,但有可能降低性能。"
249
252
250
- #: ../../c-api/stable.rst:135
253
+ #: ../../c-api/stable.rst:143
251
254
msgid ""
252
255
"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile "
253
256
"a Limited API extension with a version-specific ABI. This can improve "
@@ -260,11 +263,11 @@ msgstr ""
260
263
"版本上的性能,但也将限制其兼容性。 基于 ``Py_LIMITED_API`` 进行编译将产生一个可在版本专属扩展不可用的场合分发的扩展 – "
261
264
"例如,针对即将发布的 Python 版本的预发布包。"
262
265
263
- #: ../../c-api/stable.rst:144
266
+ #: ../../c-api/stable.rst:152
264
267
msgid "Limited API Caveats"
265
268
msgstr "受限 API 警示"
266
269
267
- #: ../../c-api/stable.rst:146
270
+ #: ../../c-api/stable.rst:154
268
271
msgid ""
269
272
"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee "
270
273
"that code conforms to the :ref:`Limited API <limited-c-api>` or the "
@@ -275,7 +278,7 @@ msgstr ""
275
278
"或 :ref:`稳定 ABI <stable-abi>`。 ``Py_LIMITED_API`` 仅仅涵盖定义部分,但一个 API "
276
279
"还包括其他因素,如预期的语义等。"
277
280
278
- #: ../../c-api/stable.rst:151
281
+ #: ../../c-api/stable.rst:159
279
282
msgid ""
280
283
"One issue that ``Py_LIMITED_API`` does not guard against is calling a "
281
284
"function with arguments that are invalid in a lower Python version. For "
@@ -288,20 +291,20 @@ msgstr ""
288
291
" 作为参数的函数。 在 Python 3.9 中,``NULL`` 现在会选择一个默认行为,但在 Python 3.8 中,该参数将被直接使用,导致一个"
289
292
" ``NULL`` 引用被崩溃。 类似的参数也适用于结构体的字段。"
290
293
291
- #: ../../c-api/stable.rst:158
294
+ #: ../../c-api/stable.rst:166
292
295
msgid ""
293
296
"Another issue is that some struct fields are currently not hidden when "
294
297
"``Py_LIMITED_API`` is defined, even though they're part of the Limited API."
295
298
msgstr "另一个问题是当定义了 ``Py_LIMITED_API`` 时某些结构体字段目前不会被隐藏,即使它们是受限 API 的一部分。"
296
299
297
- #: ../../c-api/stable.rst:161
300
+ #: ../../c-api/stable.rst:169
298
301
msgid ""
299
302
"For these reasons, we recommend testing an extension with *all* minor Python"
300
303
" versions it supports, and preferably to build with the *lowest* such "
301
304
"version."
302
305
msgstr "出于这些原因,我们建议用要支持的 *所有* Python 小版本号来测试一个扩展,并最好是用其中 *最低* 的版本来编译它。"
303
306
304
- #: ../../c-api/stable.rst:164
307
+ #: ../../c-api/stable.rst:172
305
308
msgid ""
306
309
"We also recommend reviewing documentation of all used API to check if it is "
307
310
"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a "
@@ -311,7 +314,7 @@ msgstr ""
311
314
"我们还建议查看所使用 API 的全部文档以检查其是否显式指明为受限 API 的一部分。 即使定义了 "
312
315
"``Py_LIMITED_API``,少数私有声明还是会出于技术原因(或者甚至是作为程序缺陷在无意中)被暴露出来。"
313
316
314
- #: ../../c-api/stable.rst:169
317
+ #: ../../c-api/stable.rst:177
315
318
msgid ""
316
319
"Also note that the Limited API is not necessarily stable: compiling with "
317
320
"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with "
@@ -323,11 +326,11 @@ msgstr ""
323
326
"3.12 上运行,但它将不一定能用 Python 3.12 *编译*。 特别地,在稳定 ABI 保持稳定的情况下,部分受限 API "
324
327
"可能会被弃用并被移除。"
325
328
326
- #: ../../c-api/stable.rst:179
329
+ #: ../../c-api/stable.rst:187
327
330
msgid "Platform Considerations"
328
331
msgstr "平台的考虑"
329
332
330
- #: ../../c-api/stable.rst:181
333
+ #: ../../c-api/stable.rst:189
331
334
msgid ""
332
335
"ABI stability depends not only on Python, but also on the compiler used, "
333
336
"lower-level libraries and compiler options. For the purposes of the "
@@ -337,7 +340,7 @@ msgstr ""
337
340
"ABI 的稳定性不仅取决于 Python,取决于所使用的编译器、低层级库和编译器选项等。 对于 :ref:`稳定 ABI <stable-abi>` "
338
341
"的目标来说,这些细节定义了一个 “平台”。 它们通常会依赖于 OS 类型和处理器架构等。"
339
342
340
- #: ../../c-api/stable.rst:186
343
+ #: ../../c-api/stable.rst:194
341
344
msgid ""
342
345
"It is the responsibility of each particular distributor of Python to ensure "
343
346
"that all Python versions on a particular platform are built in a way that "
@@ -347,11 +350,11 @@ msgstr ""
347
350
"确保在特定平台上的所有 Python 版本都以不破坏稳定 ABI 的方式构建是每个特定 Python 分发方的责任。 来自 ``python.org``"
348
351
" 以及许多第三方分发商的 Windows 和 macOS 发布版都必于这种情况。"
349
352
350
- #: ../../c-api/stable.rst:196
353
+ #: ../../c-api/stable.rst:204
351
354
msgid "Contents of Limited API"
352
355
msgstr "受限 API 的内容"
353
356
354
- #: ../../c-api/stable.rst:199
357
+ #: ../../c-api/stable.rst:207
355
358
msgid ""
356
359
"Currently, the :ref:`Limited API <limited-c-api>` includes the following "
357
360
"items:"
0 commit comments