Skip to content

Commit 03dcec6

Browse files
committed
fix: to rst: 530
1 parent 81211c6 commit 03dcec6

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

reference/import.po

+21-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgstr ""
77
"Project-Id-Version: Python 3.13\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2024-09-03 11:11+0800\n"
10-
"PO-Revision-Date: 2024-10-29 01:29+0800\n"
10+
"PO-Revision-Date: 2024-11-04 22:16+0800\n"
1111
"Last-Translator: Ken Cheng <[email protected]>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1313
"tw)\n"
@@ -901,6 +901,11 @@ msgid ""
901901
"``spam.foo``, ``spam`` will have an attribute ``foo`` which is bound to the "
902902
"submodule. Let's say you have the following directory structure::"
903903
msgstr ""
904+
"當使用任何機制(例如 ``importlib`` APIs,``import`` 或 ``import-from`` 陳述"
905+
"式,或內建的 ``__import__()``\\ )載入子模組時,會將子模組物件繫結到父模組的"
906+
"命名空間中。例如,如果套件 ``spam`` 有一個子模組 ``foo``,則在引入 ``spam."
907+
"foo`` 之後,``spam`` 將擁有一個名為 ``foo`` 的屬性,該屬性繫結到子模組。我們"
908+
"假設你有以下的目錄結構: ::"
904909

905910
#: ../../reference/import.rst:493
906911
msgid ""
@@ -914,7 +919,7 @@ msgstr ""
914919

915920
#: ../../reference/import.rst:497
916921
msgid "and ``spam/__init__.py`` has the following line in it::"
917-
msgstr ""
922+
msgstr "並且 ``spam/__init__.py`` 中包含以下程式碼: ::"
918923

919924
#: ../../reference/import.rst:499
920925
msgid "from .foo import Foo"
@@ -925,6 +930,7 @@ msgid ""
925930
"then executing the following puts name bindings for ``foo`` and ``Foo`` in "
926931
"the ``spam`` module::"
927932
msgstr ""
933+
"那麼執行以下程式碼會將 ``foo`` 和 ``Foo`` 的名稱繫結到 ``spam`` 模組中: ::"
928934

929935
#: ../../reference/import.rst:504
930936
msgid ""
@@ -948,10 +954,14 @@ msgid ""
948954
"foo']`` (as you would after the above import), the latter must appear as the "
949955
"``foo`` attribute of the former."
950956
msgstr ""
957+
"鑑於 Python 相似的名稱繫結規則,這可能看起來有些出人意料,但這實際上是引入系"
958+
"統的一個基本特性。不變的是如果你擁有 ``sys.modules['spam']`` 和 ``sys."
959+
"modules['spam.foo']``(就像上述引入後那樣),那麼後者必須作為前者的 ``foo`` "
960+
"屬性出現。"
951961

952962
#: ../../reference/import.rst:517
953963
msgid "Module spec"
954-
msgstr ""
964+
msgstr "模組規格"
955965

956966
#: ../../reference/import.rst:519
957967
msgid ""
@@ -960,6 +970,9 @@ msgid ""
960970
"modules. The purpose of a module's spec is to encapsulate this import-"
961971
"related information on a per-module basis."
962972
msgstr ""
973+
"引入機制在引入過程中使用有關每個模組的各種資訊,尤其是在載入之前。大多數資訊"
974+
"對所有模組來說都是通用的。模組規格的目的是以每個模組為基礎封裝這些與引入相關"
975+
"的資訊。"
963976

964977
#: ../../reference/import.rst:524
965978
msgid ""
@@ -969,13 +982,18 @@ msgid ""
969982
"machinery to perform the boilerplate operations of loading, whereas without "
970983
"a module spec the loader had that responsibility."
971984
msgstr ""
985+
"在引入過程中使用規格允許在引入系統的各個組件之間傳遞狀態,例如在建立模組規格"
986+
"的尋檢器和執行該規格的載入器之間傳遞。最重要的是,這允許引入機制執行載入的樣"
987+
"板操作,而在沒有模組規格的情況下,這些操作則是載入器的責任。"
972988

973989
#: ../../reference/import.rst:530
974990
msgid ""
975991
"The module's spec is exposed as the ``__spec__`` attribute on a module "
976992
"object. See :class:`~importlib.machinery.ModuleSpec` for details on the "
977993
"contents of the module spec."
978994
msgstr ""
995+
"模組的規格以 ``__spec__`` 屬性的形式公開在模組物件上。有關模組規格內容的詳細"
996+
"資訊,請參閱 :class:`~importlib.machinery.ModuleSpec`。"
979997

980998
#: ../../reference/import.rst:539
981999
msgid "Import-related module attributes"

0 commit comments

Comments
 (0)