@@ -55,6 +55,10 @@ msgid ""
55
55
"and :func:`enumerate`. The :keyword:`in` operator can now be used for "
56
56
"substring searches (e.g. ``\" ab\" in \" abc\" `` returns :const:`True`)."
57
57
msgstr ""
58
+ "Python 2.3 的主要主题是完善在 2.2 中添加的一些功能、为核心语言添加各种小但实用的增强功能,以及扩展标准库。 "
59
+ "上一版本引入的新对象模型已经受益于 18 个月的错误修复和优化努力,这些优化提升了新式类的性能。 新增了几个内置函数,例如 :func:`sum` 和 "
60
+ ":func:`enumerate`。 :keyword:`in` 操作符现在可以用于子字符串搜索 (例如,``\" ab\" in \" abc\" `` "
61
+ "将返回 :const:`True`)。"
58
62
59
63
#: ../../whatsnew/2.3.rst:23
60
64
msgid ""
@@ -65,6 +69,8 @@ msgid ""
65
69
"CSV files, processing command-line options, using BerkeleyDB databases... "
66
70
"the list of new and enhanced modules is lengthy."
67
71
msgstr ""
72
+ "许多新库功能包括布尔值、集合、堆、日期/时间数据类型,从ZIP格式的归档文件中导入模块的能力,期待已久的 Python 目录的元数据支持,更新版本的 "
73
+ "IDLE,以及用于日志记录、文本包装、解析 CSV 文件、处理命令行选项、使用 BerkeleyDB 数据库的模块…… 新模块和增强模块的列表相当长。"
68
74
69
75
#: ../../whatsnew/2.3.rst:30
70
76
msgid ""
@@ -75,6 +81,8 @@ msgid ""
75
81
"understand the complete implementation and design rationale, refer to the "
76
82
"PEP for a particular new feature."
77
83
msgstr ""
84
+ "本文并不试图提供对新功能的完整规范,而是提供了一个方便的概览。 有关详细信息,你应该参考 Python 2.3 的文档,例如 Python 库参考和 "
85
+ "Python 参考手册。 如果你想了解完整的实现和设计原理,请参阅特定新功能的 PEP。"
78
86
79
87
#: ../../whatsnew/2.3.rst:41
80
88
msgid "PEP 218: A Standard Set Datatype"
@@ -142,6 +150,9 @@ msgid ""
142
150
"2.2\" document; if you read it back when Python 2.2 came out, you can skip "
143
151
"the rest of this section."
144
152
msgstr ""
153
+ "在 Python 2.2 中,生成器作为一个可选特性被添加,需要通过 ``from __future__ import generators`` "
154
+ "指令来启用。 在 2.3 版本中,生成器不再需要特别启用,现在总是存在;这意味着 :keyword:`yield` 现在始终是一个关键字。 "
155
+ "本节的其余部分是从《Python 2.2的新特性》文档中复制的生成器描述;如果你在 Python 2.2 发布时已经阅读过,可以跳过本节的其余部分。"
145
156
146
157
#: ../../whatsnew/2.3.rst:136
147
158
msgid ""
@@ -155,6 +166,10 @@ msgid ""
155
166
"This is what generators provide; they can be thought of as resumable "
156
167
"functions."
157
168
msgstr ""
169
+ "你一定熟悉在 Python 或 C 语言中函数调用的工作方式。 当你调用一个函数时,它会获得一个私有命名空间,在这个命名空间中创建其局部变量。 "
170
+ "当函数执行到 :keyword:`return` 语句时,这些局部变量会被销毁,并将结果值返回给调用者。 "
171
+ "稍后对同一个函数的调用将获得一套全新的局部变量。 "
172
+ "但是,如果局部变量在函数退出时不被丢弃呢?如果你可以在函数停止的地方稍后恢复执行呢?这就是生成器所提供的功能;它们可以被视为可恢复的函数。"
158
173
159
174
#: ../../whatsnew/2.3.rst:145
160
175
msgid "Here's the simplest example of a generator function::"
@@ -167,6 +182,8 @@ msgid ""
167
182
"this is detected by Python's bytecode compiler which compiles the function "
168
183
"specially as a result."
169
184
msgstr ""
185
+ "一个新的关键字 :keyword:`yield` 被引入用于生成器。 任何包含 :keyword:`!yield` 语句的函数都是生成器函数;这由 "
186
+ "Python 的字节码编译器检测到,并因此对函数进行特殊编译。"
170
187
171
188
#: ../../whatsnew/2.3.rst:156
172
189
msgid ""
@@ -750,6 +767,7 @@ msgid ""
750
767
"The full list of classifiers can be obtained by running ``python setup.py "
751
768
"register --list-classifiers``."
752
769
msgstr ""
770
+ "完整的 classifiers 列表可通过运行 ``python setup.py register --list-classifiers`` 来获取。"
753
771
754
772
#: ../../whatsnew/2.3.rst:694
755
773
msgid ":pep:`301` - Package Index and Metadata for Distutils"
0 commit comments