Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e189ec

Browse files
[po] auto sync
1 parent dc0aa63 commit 6e189ec

2 files changed

Lines changed: 31 additions & 4 deletions

File tree

library/imp.po

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,22 @@ msgid ""
204204
"section of the :mod:`importlib` documentation for details of the various "
205205
"approaches."
206206
msgstr ""
207+
"如果之前是与 :func:`imp.find_module` 一起使用则可考虑使用 "
208+
":func:`importlib.import_module`,在其他情况下请使用你选择的 :func:`imp.find_module` "
209+
"替代品所返回的加载器。 如果你直接附带文件路径参数调用 :func:`imp.load_module` 和相关函数则请使用 "
210+
":func:`importlib.util.spec_from_file_location` 和 "
211+
":func:`importlib.util.module_from_spec` 的组合。 参见 :mod:`importlib` 文档的 "
212+
":ref:`importlib-examples` 小节来了解各种方式的细节。"
207213

208214
#: ../../library/imp.rst:126
209215
msgid ""
210216
"Return a new empty module object called *name*. This object is *not* "
211217
"inserted in ``sys.modules``."
212-
msgstr ""
218+
msgstr "返回一个新的名为 *name* 的空模块对象。 此对象 *不会* 被插入到 ``sys.modules`` 中。 "
213219

214220
#: ../../library/imp.rst:129
215221
msgid "Use :func:`importlib.util.module_from_spec` instead."
216-
msgstr ""
222+
msgstr "请改用 :func:`importlib.util.module_from_spec`。"
217223

218224
#: ../../library/imp.rst:135
219225
msgid ""
@@ -223,6 +229,9 @@ msgid ""
223229
"to try out the new version without leaving the Python interpreter. The "
224230
"return value is the module object (the same as the *module* argument)."
225231
msgstr ""
232+
"重新加载之前导入的 *module*。 该参数必须是一个模块对象,因此它之前必须已经被成功导入了。 "
233+
"这在当你已使用外部编辑器编辑过模块源代码文件并想在不退出 Python 解释器的情况下尝试新版本时会很有用处。 返回值为模块对象(与 *module* "
234+
"参数所指向的相同)。"
226235

227236
#: ../../library/imp.rst:141
228237
msgid "When ``reload(module)`` is executed:"
@@ -235,6 +244,8 @@ msgid ""
235244
"dictionary. The ``init`` function of extension modules is not called a "
236245
"second time."
237246
msgstr ""
247+
"Python 模块的代码会被重新编译并且模块层级的代码将重新执行,定义一个新的绑定到模块字典中的名称的对象集合。 扩展模块的 ``init`` "
248+
"函数不会被重复调用。"
238249

239250
#: ../../library/imp.rst:148
240251
msgid ""
@@ -281,6 +292,8 @@ msgid ""
281292
"to be initialized more than once, and may fail in arbitrary ways when "
282293
"reloaded."
283294
msgstr ""
295+
"重新加载内置或动态加载的模块是合法操作但通常不是很有用处,除非是 :mod:`sys`, :mod:`__main__` 和 "
296+
":mod:`builtins`。 但是在许多情况下,扩展模块并不是被设计为可被多次初始化的,并可能在重新加载时以任意方式失败。"
284297

285298
#: ../../library/imp.rst:178
286299
msgid ""
@@ -290,6 +303,9 @@ msgid ""
290303
"execute the :keyword:`!from` statement, another is to use :keyword:`!import`"
291304
" and qualified names (*module*.*name*) instead."
292305
msgstr ""
306+
"如果一个模块使用 :keyword:`from` ... :keyword:`import` ... 导入来自另一个模块的对象,则为另一个模块调用 "
307+
":func:`reload` 并不会重新定义从其中导入的对象 --- 绕过此问题的一种方式是重新执行 :keyword:`!from` "
308+
"语句,另一种方式是使用 :keyword:`!import` 和限定名称 (*module*.*name*) 来代替。"
293309

294310
#: ../../library/imp.rst:184
295311
msgid ""
@@ -303,11 +319,11 @@ msgstr "如果一个模块创建一个类的实例,重新加载定义那个类
303319
msgid ""
304320
"Relies on both ``__name__`` and ``__loader__`` being defined on the module "
305321
"being reloaded instead of just ``__name__``."
306-
msgstr ""
322+
msgstr "依赖于 ``__name__`` 和 ``__loader__`` 而不仅是 ``__name__`` 同时定义在被重新加载的模块上。"
307323

308324
#: ../../library/imp.rst:192
309325
msgid "Use :func:`importlib.reload` instead."
310-
msgstr ""
326+
msgstr "使用 :func:`importlib.reload` 来代替。"
311327

312328
#: ../../library/imp.rst:196
313329
msgid ""

whatsnew/3.5.po

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,16 @@ msgid ""
128128
"being iterated by ``yield from`` expressions. (Contributed by Benno Leslie "
129129
"and Yury Selivanov in :issue:`24450`.)"
130130
msgstr ""
131+
"生成器具有一个新的 ``gi_yieldfrom`` 属性,它将返回 ``yield from`` 表达式所迭代的对象。 (由 Benno Leslie"
132+
" 和 Yury Selivanov 在 :issue:`24450` 中贡献。)"
131133

132134
#: ../../whatsnew/3.5.rst:89
133135
msgid ""
134136
"A new :exc:`RecursionError` exception is now raised when maximum recursion "
135137
"depth is reached. (Contributed by Georg Brandl in :issue:`19235`.)"
136138
msgstr ""
139+
"现在当达到最大递归尝试时将引发新的 :exc:`RecursionError` 异常。 (由 Georg Brandl 在 :issue:`19235`"
140+
" 中贡献。)"
137141

138142
#: ../../whatsnew/3.5.rst:94
139143
msgid "CPython implementation improvements:"
@@ -146,20 +150,27 @@ msgid ""
146150
"``surrogateescape`` error handler, instead of the ``strict`` error handler. "
147151
"(Contributed by Victor Stinner in :issue:`19977`.)"
148152
msgstr ""
153+
"当 ``LC_TYPE`` 语言区域为 POSIX 语言区域(即 ``C`` 语言区域)时,:py:data:`sys.stdin` 和 "
154+
":py:data:`sys.stdout` 现在将使用 ``surrogateescape`` 错误处理句柄,而不是 ``strict`` "
155+
"错误处理句柄。 (由 Victor Stinner 在 :issue:`19977` 中贡献。)"
149156

150157
#: ../../whatsnew/3.5.rst:101
151158
msgid ""
152159
"``.pyo`` files are no longer used and have been replaced by a more flexible "
153160
"scheme that includes the optimization level explicitly in ``.pyc`` name. "
154161
"(See :ref:`PEP 488 overview <whatsnew-pep-488>`.)"
155162
msgstr ""
163+
"``.pyo`` 文件已不再被使用而是被替换为一个更灵活的方案即在 ``.pyc`` 名称中显式地包括优化级别。 (参见 :ref:`PEP 488 "
164+
"概览 <whatsnew-pep-488>`。)"
156165

157166
#: ../../whatsnew/3.5.rst:105
158167
msgid ""
159168
"Builtin and extension modules are now initialized in a multi-phase process, "
160169
"which is similar to how Python modules are loaded. (See :ref:`PEP 489 "
161170
"overview <whatsnew-pep-489>`.)"
162171
msgstr ""
172+
"内置与扩展模块现在将经过多阶段的过程被初始化,这类似于 Python 模块的加载方式。 (参见 :ref:`PEP 489 概览 <whatsnew-"
173+
"pep-489>`。)"
163174

164175
#: ../../whatsnew/3.5.rst:110
165176
msgid "Significant improvements in the standard library:"

0 commit comments

Comments
 (0)