@@ -582,9 +582,10 @@ msgid ""
582582"package that were explicitly loaded by previous :keyword:`import` "
583583"statements. Consider this code::"
584584msgstr ""
585- "如果没有定义 ``__all__``,``from sound.effects import *`` 语句*不*会从包 "
585+ "如果没有定义 ``__all__``,``from sound.effects import *`` 语句 *不* 会从包 "
586586":mod:`sound.effects` 中导入所有子模块到当前命名空间;它只确保导入了包 :mod:`sound.effects` (可能运行任何在 "
587- ":file:`__init__.py` 中的初始化代码),然后导入包中定义的任何名称。"
587+ ":file:`__init__.py` 中的初始化代码),然后导入包中定义的任何名称。这包括 :file:`__init__.py`` "
588+ "定义的任何名称(以及显式加载的子模块)。它还包括由之前的 :keyword:`import` 语句显式加载的包的任何子模块。思考下面的代码::"
588589
589590#: ../../tutorial/modules.rst:517
590591msgid ""
@@ -594,7 +595,7 @@ msgid ""
594595"when ``__all__`` is defined.)"
595596msgstr ""
596597"在这个例子中, :mod:`echo` 和 :mod:`surround` 模块是在执行 ``from...import`` "
597- "时导入到当前命名空间中的,它们定义在 :mod:`sound.effects` 包中。(这在定义了 ``__all__`` 时也有效。)"
598+ "语句时导入到当前命名空间中的,因为它们定义在 :mod:`sound.effects` 包中。(这在定义了 ``__all__`` 时也有效。)"
598599
599600#: ../../tutorial/modules.rst:522
600601msgid ""
@@ -610,7 +611,7 @@ msgid ""
610611"importing module needs to use submodules with the same name from different "
611612"packages."
612613msgstr ""
613- "请记住,使用 ``from package import specific_submodule`` "
614+ "请记住,使用 ``from Package import specific_submodule`` "
614615"没有任何问题!实际上,除非导入模块需要使用来自不同包的同名子模块,否则这是推荐的表示法。"
615616
616617#: ../../tutorial/modules.rst:533
@@ -625,7 +626,7 @@ msgid ""
625626":mod:`sound.filters.vocoder` needs to use the :mod:`echo` module in the "
626627":mod:`sound.effects` package, it can use ``from sound.effects import echo``."
627628msgstr ""
628- "当包被构造成子包时(与示例中的 :mod:`sound` 包一样),您可以使用绝对导入来引用兄弟包的子模块 。例如,如果模块 "
629+ "当包被构造成子包时(与示例中的 :mod:`sound` 包一样),你可以使用绝对导入来引用兄弟包的子模块 。例如,如果模块 "
629630":mod:`sound.filters.vocoder` 需要在 :mod:`sound.effects` 包中使用 :mod:`echo` "
630631"模块,它可以使用 ``from sound.effects import echo`` 。"
631632
@@ -636,8 +637,8 @@ msgid ""
636637"current and parent packages involved in the relative import. From the "
637638":mod:`surround` module for example, you might use::"
638639msgstr ""
639- "您还可以使用import语句的 ``from module import name`` "
640- "形式编写相对导入。这些导入使用前导点来指示相对导入中涉及的当前和父包 。例如,从 :mod:`surround` 模块,您可以使用 ::"
640+ "你还可以使用import语句的 ``from module import name`` "
641+ "形式编写相对导入。这些导入使用前导点来指示相对导入中涉及的当前包和父包 。例如,从 :mod:`surround` 模块,你可以使用 ::"
641642
642643#: ../../tutorial/modules.rst:550
643644msgid ""
@@ -661,8 +662,8 @@ msgid ""
661662"This variable can be modified; doing so affects future searches for modules "
662663"and subpackages contained in the package."
663664msgstr ""
664- "包支持另一个特殊属性 :attr:`__path__` 。这被初始化为一个列表 ,其中包含在执行该文件中的代码之前保存包的文件 "
665- ":file:`__init__.py` 的目录的名称。这个变量可以修改;做会影响搜索包中包含的模块和子包 。"
665+ "包支持另一个特殊属性, :attr:`__path__` 。它被初始化为一个列表 ,其中包含在执行该文件中的代码之前保存包的文件 "
666+ ":file:`__init__.py` 的目录的名称。这个变量可以修改;这样做会影响将来对包中包含的模块和子包的搜索 。"
666667
667668#: ../../tutorial/modules.rst:564
668669msgid ""
@@ -679,4 +680,4 @@ msgid ""
679680"In fact function definitions are also 'statements' that are 'executed'; the "
680681"execution of a module-level function definition enters the function name in "
681682"the module's global symbol table."
682- msgstr "实际上,函数定义也是‘声明’,并会运行;一个模块函数定义的运行会进入到此模块全局符号表里的此函数名 。"
683+ msgstr "实际上,函数定义也是 '执行'的'语句';模块级函数定义的执行在模块的全局符号表中输入该函数名 。"
0 commit comments