@@ -7,7 +7,7 @@ msgstr ""
7
7
"Project-Id-Version : Python 3.13\n "
8
8
"Report-Msgid-Bugs-To : \n "
9
9
"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 "
11
11
"
Last-Translator :
Ken Cheng <[email protected] >\n "
12
12
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
13
13
"tw)\n "
@@ -901,6 +901,11 @@ msgid ""
901
901
"``spam.foo``, ``spam`` will have an attribute ``foo`` which is bound to the "
902
902
"submodule. Let's say you have the following directory structure::"
903
903
msgstr ""
904
+ "當使用任何機制(例如 ``importlib`` APIs,``import`` 或 ``import-from`` 陳述"
905
+ "式,或內建的 ``__import__()``\\ )載入子模組時,會將子模組物件繫結到父模組的"
906
+ "命名空間中。例如,如果套件 ``spam`` 有一個子模組 ``foo``,則在引入 ``spam."
907
+ "foo`` 之後,``spam`` 將擁有一個名為 ``foo`` 的屬性,該屬性繫結到子模組。我們"
908
+ "假設你有以下的目錄結構: ::"
904
909
905
910
#: ../../reference/import.rst:493
906
911
msgid ""
@@ -914,7 +919,7 @@ msgstr ""
914
919
915
920
#: ../../reference/import.rst:497
916
921
msgid "and ``spam/__init__.py`` has the following line in it::"
917
- msgstr ""
922
+ msgstr "並且 ``spam/__init__.py`` 中包含以下程式碼: :: "
918
923
919
924
#: ../../reference/import.rst:499
920
925
msgid "from .foo import Foo"
@@ -925,6 +930,7 @@ msgid ""
925
930
"then executing the following puts name bindings for ``foo`` and ``Foo`` in "
926
931
"the ``spam`` module::"
927
932
msgstr ""
933
+ "那麼執行以下程式碼會將 ``foo`` 和 ``Foo`` 的名稱繫結到 ``spam`` 模組中: ::"
928
934
929
935
#: ../../reference/import.rst:504
930
936
msgid ""
@@ -948,10 +954,14 @@ msgid ""
948
954
"foo']`` (as you would after the above import), the latter must appear as the "
949
955
"``foo`` attribute of the former."
950
956
msgstr ""
957
+ "鑑於 Python 相似的名稱繫結規則,這可能看起來有些出人意料,但這實際上是引入系"
958
+ "統的一個基本特性。不變的是如果你擁有 ``sys.modules['spam']`` 和 ``sys."
959
+ "modules['spam.foo']``(就像上述引入後那樣),那麼後者必須作為前者的 ``foo`` "
960
+ "屬性出現。"
951
961
952
962
#: ../../reference/import.rst:517
953
963
msgid "Module spec"
954
- msgstr ""
964
+ msgstr "模組規格 "
955
965
956
966
#: ../../reference/import.rst:519
957
967
msgid ""
@@ -960,6 +970,9 @@ msgid ""
960
970
"modules. The purpose of a module's spec is to encapsulate this import-"
961
971
"related information on a per-module basis."
962
972
msgstr ""
973
+ "引入機制在引入過程中使用有關每個模組的各種資訊,尤其是在載入之前。大多數資訊"
974
+ "對所有模組來說都是通用的。模組規格的目的是以每個模組為基礎封裝這些與引入相關"
975
+ "的資訊。"
963
976
964
977
#: ../../reference/import.rst:524
965
978
msgid ""
@@ -969,13 +982,18 @@ msgid ""
969
982
"machinery to perform the boilerplate operations of loading, whereas without "
970
983
"a module spec the loader had that responsibility."
971
984
msgstr ""
985
+ "在引入過程中使用規格允許在引入系統的各個組件之間傳遞狀態,例如在建立模組規格"
986
+ "的尋檢器和執行該規格的載入器之間傳遞。最重要的是,這允許引入機制執行載入的樣"
987
+ "板操作,而在沒有模組規格的情況下,這些操作則是載入器的責任。"
972
988
973
989
#: ../../reference/import.rst:530
974
990
msgid ""
975
991
"The module's spec is exposed as the ``__spec__`` attribute on a module "
976
992
"object. See :class:`~importlib.machinery.ModuleSpec` for details on the "
977
993
"contents of the module spec."
978
994
msgstr ""
995
+ "模組的規格以 ``__spec__`` 屬性的形式公開在模組物件上。有關模組規格內容的詳細"
996
+ "資訊,請參閱 :class:`~importlib.machinery.ModuleSpec`。"
979
997
980
998
#: ../../reference/import.rst:539
981
999
msgid "Import-related module attributes"
0 commit comments