@@ -1488,13 +1488,20 @@ msgid ""
14881488" buggy modules have all been fixed to use :const:`!ascii_letters` instead. "
14891489"(Reported by an unknown person; fixed by Fred L. Drake, Jr.)"
14901490msgstr ""
1491+ "为 :mod:`string` 模块增加了新的常量 :const:`!ascii_letters`, :const:`!ascii_lowercase`"
1492+ " 和 :const:`!ascii_uppercase`。 标准库中有一些模块使用 :const:`!string.letters` 来表示 "
1493+ "A-Za-z,但当使用不同语言区域时其含义并不正确,因为 :const:`!string.letters` "
1494+ "会根据当前语言区域所定义的合法字符集而发生变化。 这些有问题的模块已全部被修正为改用 :const:`!ascii_letters`。 "
1495+ "(由未知人士报告;由 Fred L. Drake, Jr. 修正)。"
14911496
14921497#: ../../whatsnew/2.2.rst:1037
14931498msgid ""
14941499"The :mod:`mimetypes` module now makes it easier to use alternative MIME-type"
14951500" databases by the addition of a :class:`~mimetypes.MimeTypes` class, which "
14961501"takes a list of filenames to be parsed. (Contributed by Fred L. Drake, Jr.)"
14971502msgstr ""
1503+ "现在 :mod:`mimetypes` 模块通过添加 :class:`~mimetypes.MimeTypes` 类让使用不同的 MIME "
1504+ "类型数据库更为容易,该类接受一个文件名列表供解析。 (由 Fred L. Drake, Jr. 贡献。)"
14981505
14991506#: ../../whatsnew/2.2.rst:1041
15001507msgid ""
@@ -1531,6 +1538,10 @@ msgid ""
15311538"exist, and have simply been changed to use the new C-level interface. "
15321539"(Contributed by Fred L. Drake, Jr.)"
15331540msgstr ""
1541+ "性能分析和追踪函数现在可以用 C 语言来实现,相比基于 Python 的函数能够显著提高运行速度并能够减少性能分析和追踪的资源开销。 Python "
1542+ "开发环境的编写者对此将会很感兴趣。 Python 的 API 增加了两个新的 C 函数,:c:func:`PyEval_SetProfile` 和 "
1543+ ":c:func:`PyEval_SetTrace`。 现有的 :func:`sys.setprofile` 和 :func:`sys.settrace`"
1544+ " 函数仍然存在,并已简单地更改为使用新的 C 层级接口。 (由 Fred L. Drake, Jr. 贡献。)"
15341545
15351546#: ../../whatsnew/2.2.rst:1065
15361547msgid ""
@@ -1542,6 +1553,10 @@ msgid ""
15421553"allow looping over all the thread states for a given interpreter. "
15431554"(Contributed by David Beazley.)"
15441555msgstr ""
1556+ "增加了另一套低层级 API,它主要面向 Python 调试器和开发工具的实现者。 :c:func:`PyInterpreterState_Head` 和"
1557+ " :c:func:`PyInterpreterState_Next` "
1558+ "可让调用方访问所有现存的解释器对象;:c:func:`PyInterpreterState_ThreadHead` 和 "
1559+ ":c:func:`PyThreadState_Next` 允许对某个解释器的所有线程状态执行循环。 (由 David Beazley 贡献。)"
15451560
15461561#: ../../whatsnew/2.2.rst:1072
15471562msgid ""
@@ -1589,7 +1604,7 @@ msgstr "从对象大小计算中移除 :c:macro:`!PyGC_HEAD_SIZE`。"
15891604#: ../../whatsnew/2.2.rst:1091
15901605msgid ""
15911606"Remove calls to :c:func:`!PyObject_AS_GC` and :c:func:`!PyObject_FROM_GC`."
1592- msgstr ""
1607+ msgstr "移除对 :c:func:`!PyObject_AS_GC` 和 :c:func:`!PyObject_FROM_GC` 的调用。 "
15931608
15941609#: ../../whatsnew/2.2.rst:1093
15951610msgid ""
@@ -1641,6 +1656,8 @@ msgid ""
16411656"can simply be discarded when porting code from earlier versions to Python "
16421657"2.2."
16431658msgstr ""
1659+ ":c:func:`_PyTuple_Resize` 函数去掉了一个未使用的形参,因此现在它接受 2 个形参而不是 3 个。 "
1660+ "第三个参数从未被使用,在将代码从较早的版本移植到 Python 2.2 时可以简单地丢弃它。"
16441661
16451662#: ../../whatsnew/2.2.rst:1129
16461663msgid "Other Changes and Fixes"
@@ -1714,6 +1731,8 @@ msgid ""
17141731"automatically removes obsolete ``__future__`` statements from Python source "
17151732"code."
17161733msgstr ""
1734+ "由 Tim Peters 编写的新脚本 :file:`Tools/scripts/cleanfuture.py` 可自动从 Python "
1735+ "源代码移除过时的 ``__future__`` 语句。"
17171736
17181737#: ../../whatsnew/2.2.rst:1189
17191738msgid ""
@@ -1723,6 +1742,9 @@ msgid ""
17231742"other development environments. This is described in :pep:`264`. "
17241743"(Contributed by Michael Hudson.)"
17251744msgstr ""
1745+ "向内置函数 :func:`compile` 添加了一个额外的 *flags* 参数,以便现在 ``__future__`` 语句的行为能在模拟的 "
1746+ "shell,例如由 IDLE 和其他开发环境所提供的此类工具中被正确地观察。 此特性的描述参见 :pep:`264`。 (由 Michael "
1747+ "Hudson 贡献。)"
17261748
17271749#: ../../whatsnew/2.2.rst:1195
17281750msgid ""
@@ -1827,6 +1849,9 @@ msgid ""
18271849":c:func:`dlopen` using the :func:`sys.getdlopenflags` and "
18281850":func:`sys.setdlopenflags` functions. (Contributed by Bram Stolk.)"
18291851msgstr ""
1852+ "在 Python 会使用 C :c:func:`dlopen` 函数来加载扩展模块的平台上,现在可以使用 "
1853+ ":func:`sys.getdlopenflags` 和 :func:`sys.setdlopenflags` 等函数来设置 "
1854+ ":c:func:`dlopen` 所使用的旗标。 (由 Bram Stolk 贡献。)"
18301855
18311856#: ../../whatsnew/2.2.rst:1250
18321857msgid ""
@@ -1836,6 +1861,9 @@ msgid ""
18361861"result varies unpredictably depending on the platform. A call such as "
18371862"``pow(2.0, 8.0, 7.0)`` will now raise a :exc:`TypeError` exception."
18381863msgstr ""
1864+ "当传入浮点数时 :func:`pow` 内置函数已不再支持 3 个参数。 ``pow(x, y, z)`` 将返回 ``(x**y) % "
1865+ "z``,但这对于浮点数来说没有用处,并且其最终结果会因具体平台的不同而产生不可预料的变化。 现在 ``pow(2.0, 8.0, 7.0)`` "
1866+ "这样的调用将会引发 :exc:`TypeError` 异常。"
18391867
18401868#: ../../whatsnew/2.2.rst:1260
18411869msgid "Acknowledgements"
0 commit comments