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