@@ -3775,6 +3775,25 @@ msgid ""
3775
3775
"are no longer needed because their functions are now handled automatically "
3776
3776
"by the import system."
3777
3777
msgstr ""
3778
+ "正如 :ref:`whatsnew-pep-451` 所提及的,:mod:`importlib` 中的多个方法和函数已被弃用: "
3779
+ ":meth:`!importlib.find_loader` 被 :func:`importlib.util.find_spec` 替代; "
3780
+ ":meth:`!importlib.machinery.PathFinder.find_module` 被 "
3781
+ ":meth:`importlib.machinery.PathFinder.find_spec` 替代; "
3782
+ ":meth:`!importlib.abc.MetaPathFinder.find_module` 被 "
3783
+ ":meth:`importlib.abc.MetaPathFinder.find_spec` 替代; "
3784
+ ":meth:`!importlib.abc.PathEntryFinder.find_loader` 和 :meth:`!find_module` 被 "
3785
+ ":meth:`importlib.abc.PathEntryFinder.find_spec` 替代; 所有的 :samp:`{xxx}Loader` "
3786
+ "ABC ``load_module`` 方法 (:meth:`!importlib.abc.Loader.load_module`, "
3787
+ ":meth:`!importlib.abc.InspectLoader.load_module`, "
3788
+ ":meth:`!importlib.abc.FileLoader.load_module`, "
3789
+ ":meth:`!importlib.abc.SourceLoader.load_module`) 应当不再被实现,加载器应当改为实现 "
3790
+ "``exec_module`` 方法 (:meth:`importlib.abc.Loader.exec_module`, "
3791
+ ":meth:`importlib.abc.InspectLoader.exec_module` "
3792
+ ":meth:`importlib.abc.SourceLoader.exec_module`) 并让导入系统处理其余的操作; 而 "
3793
+ ":meth:`!importlib.abc.Loader.module_repr`, "
3794
+ ":meth:`!importlib.util.module_for_loader`, "
3795
+ ":meth:`!importlib.util.set_loader` 和 :meth:`!importlib.util.set_package` "
3796
+ "已不再需要因为它们的功能现在将由导入系统自动处理。"
3778
3797
3779
3798
#: ../../whatsnew/3.4.rst:2103
3780
3799
msgid ""
@@ -4002,6 +4021,10 @@ msgid ""
4002
4021
"objects that do not have a __format__ method that handles it. See "
4003
4022
":issue:`7994` for background."
4004
4023
msgstr ""
4024
+ ":meth:`object.__format__` 不再接受非空格式字符串,它现在会改为引发 :exc:`TypeError`。 使用非空字符串自 "
4025
+ "Python 3.2 起已被弃用。 做出此项改变是为了防止当对象获得 __format__ "
4026
+ "方法时之前可用(但不正确)的代码执行失败的情况,这意味着现在当你对没有用于处理 ``'s'`` 的 __format__ "
4027
+ "方法的对象使用该格式代码时你的代码可能会引发 :exc:`TypeError`。 请参阅 :issue:`7994` 了解相关背景。"
4005
4028
4006
4029
#: ../../whatsnew/3.4.rst:2215
4007
4030
msgid ""
0 commit comments