@@ -3013,6 +3013,8 @@ msgid ""
30133013"New :class:`~weakref.WeakMethod` class simulates weak references to bound "
30143014"methods. (Contributed by Antoine Pitrou in :issue:`14631`.)"
30153015msgstr ""
3016+ "新增的 :class:`~weakref.WeakMethod` 类可模拟指向绑定方法的弱引用。 (由 Antoine Pitrou 在 "
3017+ ":issue:`14631` 中贡献。)"
30163018
30173019#: ../../whatsnew/3.4.rst:1754
30183020msgid ""
@@ -3021,13 +3023,18 @@ msgid ""
30213023"to carefully manage the lifecycle of the weak reference itself. "
30223024"(Contributed by Richard Oudkerk in :issue:`15528`.)"
30233025msgstr ""
3026+ "新增的 :class:`~weakref.finalize` "
3027+ "类使得注册一个当对象被作为垃圾回收时发起调用的回调成为可能,而无需小心地管理弱引用本身的生命周期。 (由 Richard Oudkerk 在 "
3028+ ":issue:`15528` 中贡献。)"
30243029
30253030#: ../../whatsnew/3.4.rst:1759
30263031msgid ""
30273032"The callback, if any, associated with a :class:`~weakref.ref` is now exposed"
30283033" via the :attr:`~weakref.ref.__callback__` attribute. (Contributed by Mark "
30293034"Dickinson in :issue:`17643`.)"
30303035msgstr ""
3036+ "如果存在任何与 :class:`~weakref.ref` 相关联的回调,现在将通过 :attr:`~weakref.ref.__callback__`"
3037+ " 属性对外公开。 (由 Mark Dickinson 在 :issue:`17643` 中贡献。)"
30313038
30323039#: ../../whatsnew/3.4.rst:1765
30333040msgid "xml.etree"
@@ -3040,6 +3047,9 @@ msgid ""
30403047":ref:`elementtree-pull-parsing`. (Contributed by Antoine Pitrou in "
30413048":issue:`17741`.)"
30423049msgstr ""
3050+ "新增的解析器 :class:`~xml.etree.ElementTree.XMLPullParser` 允许用非阻塞的应用程序来解析 XML 文档。 "
3051+ "相关示例可参见 :ref:`elementtree-pull-parsing`。 (由 Antoine Pitrou 在 :issue:`17741` "
3052+ "中贡献。)"
30433053
30443054#: ../../whatsnew/3.4.rst:1772
30453055msgid ""
@@ -3052,6 +3062,13 @@ msgid ""
30523062" written in abbreviated (``<tag />``) or expanded (``<tag></tag>``) form. "
30533063"(Contributed by Ariel Poliak and Serhiy Storchaka in :issue:`14377`.)"
30543064msgstr ""
3065+ "现在 :mod:`xml.etree.ElementTree` :func:`~xml.etree.ElementTree.tostring` 和 "
3066+ ":func:`~xml.etree.ElementTree.tostringlist` 函数,以及 "
3067+ ":class:`~xml.etree.ElementTree.ElementTree` 的 "
3068+ ":meth:`~xml.etree.ElementTree.ElementTree.write` 方法都具有一个 "
3069+ "*short_empty_elements* :ref:`仅限关键字形参 <keyword-only_parameter>` "
3070+ "用来提供对于无内容的元素要采取缩写 (``<tag />``) 还是扩展 (``<tag></tag>``) 形式的控制。 (由 Ariel "
3071+ "Poliak 和 Serhiy Storchaka 在 :issue:`14377` 中贡献。)"
30553072
30563073#: ../../whatsnew/3.4.rst:1783
30573074msgid "zipfile"
@@ -3065,13 +3082,18 @@ msgid ""
30653082"example, this could be used to exclude test files from the archive. "
30663083"(Contributed by Christian Tismer in :issue:`19274`.)"
30673084msgstr ""
3085+ ":class:`~zipfile.PyZipFile` 类的 :meth:`~zipfile.PyZipFile.writepy` 方法新增的 "
3086+ "*filterfunc* 选项可用来控制要将哪些目录添加到归档中。 例如,可以用它将测试文件排除在归档之外。 (由 Christian Tismer 在"
3087+ " :issue:`19274` 中贡献。)"
30683088
30693089#: ../../whatsnew/3.4.rst:1791
30703090msgid ""
30713091"The *allowZip64* parameter to :class:`~zipfile.ZipFile` and "
30723092":class:`~zipfile.PyZipfile` is now ``True`` by default. (Contributed by "
30733093"William Mallard in :issue:`17201`.)"
30743094msgstr ""
3095+ "现在 :class:`~zipfile.ZipFile` 和 :class:`~zipfile.PyZipfile` 的 *allowZip64* "
3096+ "形参默认值为 ``True``。 (由 William Mallard 在 :issue:`17201` 中贡献。)"
30753097
30763098#: ../../whatsnew/3.4.rst:1798
30773099msgid "CPython Implementation Changes"
@@ -3102,6 +3124,8 @@ msgid ""
31023124"generators with :keyword:`finally` clauses, can be finalized when they are "
31033125"part of a reference cycle."
31043126msgstr ""
3127+ ":pep:`442` 移除了 CPython 中有关对象最终化的限制和特殊处理。 有了它,具有 :meth:`__del__` 方法的对象,以及具有 "
3128+ ":keyword:`finally` 子句的生成器在有循环引用的情况下也可以被最终化。"
31053129
31063130#: ../../whatsnew/3.4.rst:1825
31073131msgid ""
@@ -3111,10 +3135,12 @@ msgid ""
31113135"class of interpreter-shutdown-time errors, usually involving ``__del__`` "
31123136"methods, that have plagued Python since the cyclic GC was first introduced."
31133137msgstr ""
3138+ "作为此项改变的一部分,大多数情况下在解释器关闭期间模块的全局变量不会被强制设为 :const:`None`,而是取决于循环垃圾回收器的正常操作。 "
3139+ "这避免了大量的解释器关闭时错误,这类错误通常都涉及 ``__del__`` 方法,它们自循环 GC 首次被引入起就一直困扰着 Python。"
31143140
31153141#: ../../whatsnew/3.4.rst:1834
31163142msgid ":pep:`442` -- Safe object finalization"
3117- msgstr ""
3143+ msgstr ":pep:`442` -- 安全的对象最终化 "
31183144
31193145#: ../../whatsnew/3.4.rst:1841
31203146msgid "PEP 456: Secure and Interchangeable Hash Algorithm"
0 commit comments