@@ -1150,6 +1150,11 @@ msgid ""
1150
1150
"writing decorators and any code that validates or amends calling signatures "
1151
1151
"or arguments."
1152
1152
msgstr ""
1153
+ "新增的函数 :func:`inspect.signature` 使得对 python 可调用对象的内省更为简单直观。 "
1154
+ "多种可调用对象均受到支持:不论是否带装饰器的 python 函数,类以及 :func:`functools.partial` 对象。 新增的类 "
1155
+ ":class:`inspect.Signature`, :class:`inspect.Parameter` 和 "
1156
+ ":class:`inspect.BoundArguments` "
1157
+ "保存了有关调用签名的信息,如标注、默认值、形参类别和绑定参数等,这极大地简化了编写装饰器和其他任何验证或修改调用签名或参数的工作。"
1153
1158
1154
1159
#: ../../whatsnew/3.3.rst:643
1155
1160
msgid ":pep:`362`: - Function Signature Object"
@@ -1174,6 +1179,8 @@ msgid ""
1174
1179
"attributes on :data:`sys.implementation` are ``name``, ``version``, "
1175
1180
"``hexversion``, and ``cache_tag``."
1176
1181
msgstr ""
1182
+ "新增的 :mod:`sys` 模块属性将对外公开当前运行的解释器实现的专属细节。 :data:`sys.implementation` "
1183
+ "上的初始属性集合包括 ``name``, ``version``, ``hexversion`` 和 ``cache_tag``。"
1177
1184
1178
1185
#: ../../whatsnew/3.3.rst:656
1179
1186
msgid ""
@@ -1184,6 +1191,9 @@ msgid ""
1184
1191
"only a small portion of the implementation-specific data. Over time that "
1185
1192
"ratio will shift in order to make the standard library more portable."
1186
1193
msgstr ""
1194
+ "``sys.implementation`` 的目的是将标准库所使用的具体实现专属数据合并到一个命名空间中。 这允许不同的 Python "
1195
+ "实现能更方便地共享同一个标准库基准代码。 在其初始状态中,``sys.implementation`` 只保持具体实现专属数据的一小部分。 "
1196
+ "随着时间推移这个比例将进行调整以使标准库具有更好的可移植性。"
1187
1197
1188
1198
#: ../../whatsnew/3.3.rst:663
1189
1199
msgid ""
@@ -1193,10 +1203,14 @@ msgid ""
1193
1203
"``importlib`` for its built-in import system may use ``cache_tag`` to "
1194
1204
"control the caching behavior for modules."
1195
1205
msgstr ""
1206
+ "标准库可移植性提高的一个例子是 ``cache_tag``。 在 Python 3.3 "
1207
+ "中,``sys.implementation.cache_tag`` 被 :mod:`importlib` 用来支持与 :pep:`3147` "
1208
+ "的一致性。 任何使用 ``importlib`` 来处理内置导入系统的 Python 实现都可使用 ``cache_tag`` "
1209
+ "来控制各个模块的缓存行为。"
1196
1210
1197
1211
#: ../../whatsnew/3.3.rst:670
1198
1212
msgid "SimpleNamespace"
1199
- msgstr ""
1213
+ msgstr "SimpleNamespace "
1200
1214
1201
1215
#: ../../whatsnew/3.3.rst:672
1202
1216
msgid ""
@@ -1207,6 +1221,10 @@ msgid ""
1207
1221
"are writable. This means that you can add, remove, and modify the namespace"
1208
1222
" through normal attribute access."
1209
1223
msgstr ""
1224
+ "``sys.implementation`` 的实现还为 Python 引入了一个新类型: "
1225
+ ":class:`types.SimpleNamespace`。 相比基于映射的命名空间像是 "
1226
+ ":class:`dict`,``SimpleNamespace`` 是基于属性的,像是 :class:`object`。 不过,与 ``object``"
1227
+ " 不同,``SimpleNamespace`` 实例是可写的。 这意味着你可以通过常规的属性访问来添加、移除和修改命名空间。"
1210
1228
1211
1229
#: ../../whatsnew/3.3.rst:681
1212
1230
msgid ":pep:`421` - Adding sys.implementation"