@@ -15,7 +15,7 @@ msgid ""
15
15
msgstr ""
16
16
"Project-Id-Version : Python 3.9\n "
17
17
"Report-Msgid-Bugs-To : \n "
18
- "POT-Creation-Date : 2024-03-01 21:26 +0000\n "
18
+ "POT-Creation-Date : 2024-05-24 16:33 +0000\n "
19
19
"PO-Revision-Date : 2017-02-16 23:42+0000\n "
20
20
"Last-Translator : Freesand Leo <yuqinju@163.com>, 2024\n "
21
21
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -192,6 +192,9 @@ msgid ""
192
192
"off, but users will have had all of 2.1's lifetime to fix any breakage "
193
193
"resulting from their introduction."
194
194
msgstr ""
195
+ "由于兼容性问题,嵌套作用域被逐步引入;在 Python 2.1 中,它们默认未启用,但可以通过在模块中使用 future 语句来开启,如 "
196
+ ":pep:`236` 所述。 (参见下一节对 :pep:`236` 的进一步讨论。) 在 Python 2.2 "
197
+ "中,嵌套作用域将成为默认设置,并且无法关闭,但用户将有整个 2.1 版本的生命周期来修复因引入嵌套作用域而导致的任何问题。"
195
198
196
199
#: ../../whatsnew/2.1.rst:123
197
200
msgid ":pep:`227` - Statically Nested Scopes"
@@ -213,13 +216,15 @@ msgid ""
213
216
"introducing a convention for enabling optional functionality in release N "
214
217
"that will become compulsory in release N+1."
215
218
msgstr ""
219
+ "对嵌套作用域的反应引起了广泛关注,人们担心在 Python 2.1 版本发布时会破坏现有代码,强烈的反应促使 Python "
220
+ "开发者采取了更保守的策略。这个策略包括引入一种约定,在版本 N 中启用可选功能,该功能将在版本 N+1 中成为强制功能。"
216
221
217
222
#: ../../whatsnew/2.1.rst:138
218
223
msgid ""
219
224
"The syntax uses a ``from...import`` statement using the reserved module name"
220
225
" :mod:`__future__`. Nested scopes can be enabled by the following "
221
226
"statement::"
222
- msgstr ""
227
+ msgstr "语法使用 ``from...import`` 语句,使用保留模块名 :mod:`__future__`。可以通过以下语句启用嵌套作用域:: "
223
228
224
229
#: ../../whatsnew/2.1.rst:143
225
230
msgid ""
@@ -230,6 +235,9 @@ msgid ""
230
235
"how the Python bytecode compiler parses code and generates bytecode, so they"
231
236
" must precede any statement that will result in bytecodes being produced."
232
237
msgstr ""
238
+ "虽然它看起来像一个普通的 :keyword:`import` 语句,但实际上并不是;关于此类 future "
239
+ "语句的位置有严格的规定。它们只能放在模块的顶部,必须位于任何 Python 代码或常规 :keyword:`!import` "
240
+ "语句之前。这是因为这样的语句会影响 Python 字节码编译器解析代码和生成字节码的方式,因此它们必须在任何会生成字节码的语句之前出现。"
233
241
234
242
#: ../../whatsnew/2.1.rst:153
235
243
msgid ":pep:`236` - Back to the :mod:`__future__`"
@@ -266,6 +274,8 @@ msgid ""
266
274
"``>``, ``>=``, ``==``, and ``!=`` operations. The new magic method names "
267
275
"are:"
268
276
msgstr ""
277
+ "在 Python 2.1 中增加了富比较操作以支持这一需求。 Python 类现在可以单独重载 ``<``, ``<=``, ``>``, "
278
+ "``>=``, ``==`` 和 ``!=`` 中的每个操作。 新的魔术方法名称如下:"
269
279
270
280
#: ../../whatsnew/2.1.rst:179
271
281
msgid "Operation"
@@ -329,6 +339,8 @@ msgid ""
329
339
"``.LT.``. ``.LE.``, &c. Numeric programmers are almost certainly quite "
330
340
"familiar with these names and will find them easy to remember.)"
331
341
msgstr ""
342
+ "(这些魔术方法是以对应的 Fortran 操作符命名的,如 ``.LT.``、``.LE.`` 等。 "
343
+ "数值程序员几乎肯定对这些名称非常熟悉,并且会发现它们易于记忆。)"
332
344
333
345
#: ../../whatsnew/2.1.rst:198
334
346
msgid ""
@@ -337,6 +349,8 @@ msgid ""
337
349
"``other`` will be the object on the right-hand side. For example, the "
338
350
"expression ``A < B`` will cause ``A.__lt__(B)`` to be called."
339
351
msgstr ""
352
+ "每个这样的魔术方法的形式都是 ``method(self, other)``,其中 ``self`` 是操作符左侧的对象,而 ``other`` "
353
+ "是操作符右侧的对象。 例如,表达式 ``A < B`` 会调用 ``A.__lt__(B)``。"
340
354
341
355
#: ../../whatsnew/2.1.rst:203
342
356
msgid ""
@@ -345,6 +359,7 @@ msgid ""
345
359
"exception if the comparison is impossible, inconsistent, or otherwise "
346
360
"meaningless."
347
361
msgstr ""
362
+ "这些魔术方法可以返回任何类型的值:布尔值、矩阵、列表或任何其他 Python 对象。或者,如果比较是不可能的、不一致的或没有意义的,它们也可以引发异常。"
348
363
349
364
#: ../../whatsnew/2.1.rst:207
350
365
msgid ""
@@ -365,6 +380,8 @@ msgid ""
365
380
":pep:`207`, or to 2.1's C API documentation, for the full list of related "
366
381
"functions."
367
382
msgstr ""
383
+ "对于 C 程序员来说,也有相应的变更;类型对象中有一个新的槽位 ``tp_richcmp`` 以及一个用于执行指定富比较的 API。 这里我不会涉及 C"
384
+ " API 的具体内容,完整的相关函数列表请参阅 :pep:`207` 或 2.1 的 C API 文档。"
368
385
369
386
#: ../../whatsnew/2.1.rst:223
370
387
msgid ":pep:`207` - Rich Comparisons"
@@ -392,6 +409,10 @@ msgid ""
392
409
" following Python version can then drop the feature, and users will have had"
393
410
" a full release cycle to remove uses of the old feature."
394
411
msgstr ""
412
+ "在过去的 10 年中,Python 积累了一定数量的过时模块和功能。 "
413
+ "由于无法确切知道某个功能被使用的程度:可能没有程序依赖该功能,也可能有很多程序依赖,因此很难确定何时可以安全地移除某个功能,为了以更结构化的方式移除旧功能,添加了一个警告框架。"
414
+ " 当 Python 开发者想要废弃某个功能时,它会在下一个 Python 版本中首先触发一个警告。 "
415
+ "然后,在随后的Python版本中可以移除该功能,这样用户将有一个完整的发布周期来删除对旧功能的使用。"
395
416
396
417
#: ../../whatsnew/2.1.rst:242
397
418
msgid ""
@@ -401,6 +422,8 @@ msgid ""
401
422
" can also use this framework to deprecate old features that they no longer "
402
423
"wish to support."
403
424
msgstr ""
425
+ "Python 2.1 增加了警告框架以用于此方案。 它增加了一个 :mod:`warnings` "
426
+ "模块,该模块提供了发出警告的函数,以及过滤掉不想显示的警告的功能。 第三方模块也可以使用这个框架来弃用它们不再希望支持的旧功能。"
404
427
405
428
#: ../../whatsnew/2.1.rst:248
406
429
msgid ""
0 commit comments