@@ -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-11-06 14:55 +0800\n "
10
+ "PO-Revision-Date : 2024-12-11 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 "
@@ -1007,7 +1007,7 @@ msgstr ""
1007
1007
1008
1008
#: ../../reference/import.rst:546
1009
1009
msgid "__path__ attributes on modules"
1010
- msgstr ""
1010
+ msgstr "模組上的 __path__ 屬性 "
1011
1011
1012
1012
#: ../../reference/import.rst:548
1013
1013
msgid ""
@@ -1016,6 +1016,9 @@ msgid ""
1016
1016
"submodules will be found. By definition, if a module has a :attr:`!__path__` "
1017
1017
"attribute, it is a :term:`package`."
1018
1018
msgstr ""
1019
+ ":attr:`~module.__path__` 屬性應該是一個(可能為空的)\\ :term:`sequence`,其"
1020
+ "包含列舉套件子模組位置的字串。根據定義,如果一個模組有 :attr:`!__path__` 屬"
1021
+ "性,那麼它就是一個 :term:`package`。"
1019
1022
1020
1023
#: ../../reference/import.rst:553
1021
1024
msgid ""
@@ -1025,13 +1028,18 @@ msgid ""
1025
1028
"during import. However, :attr:`!__path__` is typically much more constrained "
1026
1029
"than :data:`!sys.path`."
1027
1030
msgstr ""
1031
+ "套件的 :attr:`~module.__path__` 屬性在引入其子套件時被使用。在引入機制中,其"
1032
+ "功能與 :data:`sys.path` 類似,即提供在引入期間搜尋模組的位置串列。然而,:"
1033
+ "attr:`!__path__` 通常比 :data:`!sys.path` 更受限制。"
1028
1034
1029
1035
#: ../../reference/import.rst:560
1030
1036
msgid ""
1031
1037
"The same rules used for :data:`sys.path` also apply to a package's :attr:`!"
1032
1038
"__path__`. :data:`sys.path_hooks` (described below) are consulted when "
1033
1039
"traversing a package's :attr:`!__path__`."
1034
1040
msgstr ""
1041
+ ":data:`sys.path` 適用的規則同樣也適用於套件的 :attr:`!__path__`。 :data:`sys."
1042
+ "path_hooks` 會在遍歷套件的 :attr:`!__path__` 時被參考(於後文詳述)。"
1035
1043
1036
1044
#: ../../reference/import.rst:564
1037
1045
msgid ""
@@ -1042,17 +1050,23 @@ msgid ""
1042
1050
"containing only :attr:`!__path__` manipulation code; the import machinery "
1043
1051
"automatically sets :attr:`!__path__` correctly for the namespace package."
1044
1052
msgstr ""
1053
+ "套件的 ``__init__.py`` 檔案可以設定或修改套件的 :attr:`~module.__path__` 屬"
1054
+ "性,這通常是 :pep:`420` 之前實作命名空間套件的方式。隨著 :pep:`420` 的採用,"
1055
+ "命名空間套件不再需要提供僅包含 :attr:`!__path__` 操作程式碼的 ``__init__."
1056
+ "py`` 檔案;引入機制會自動為命名空間套件正確地設定 :attr:`!__path__`。"
1045
1057
1046
1058
#: ../../reference/import.rst:573
1047
1059
msgid "Module reprs"
1048
- msgstr ""
1060
+ msgstr "模組的 reprs "
1049
1061
1050
1062
#: ../../reference/import.rst:575
1051
1063
msgid ""
1052
1064
"By default, all modules have a usable repr, however depending on the "
1053
1065
"attributes set above, and in the module's spec, you can more explicitly "
1054
1066
"control the repr of module objects."
1055
1067
msgstr ""
1068
+ "預設情況下,所有模組都有可用的 repr,然而,根據上述設定及模組規格中的屬性,你"
1069
+ "可以更明確地控制模組物件的 repr。"
1056
1070
1057
1071
#: ../../reference/import.rst:579
1058
1072
msgid ""
@@ -1063,40 +1077,50 @@ msgid ""
1063
1077
"__file__``, and ``module.__loader__`` as input into the repr, with defaults "
1064
1078
"for whatever information is missing."
1065
1079
msgstr ""
1080
+ "如果模組具有規格(\\ ``__spec__``\\ ),引入機制將嘗試從規格中產生 repr。如果"
1081
+ "失敗或沒有規格,引入系統將使用模組上可用的資訊製作一個預設的 repr。它會嘗試使"
1082
+ "用 ``module.__name__``、``module.__file__`` 和 ``module.__loader__`` 作為 "
1083
+ "repr 的輸入,並為缺少的資訊提供預設值。"
1066
1084
1067
1085
#: ../../reference/import.rst:586
1068
1086
msgid "Here are the exact rules used:"
1069
- msgstr ""
1087
+ msgstr "以下是具體的使用規則: "
1070
1088
1071
1089
#: ../../reference/import.rst:588
1072
1090
msgid ""
1073
1091
"If the module has a ``__spec__`` attribute, the information in the spec is "
1074
1092
"used to generate the repr. The \" name\" , \" loader\" , \" origin\" , and "
1075
1093
"\" has_location\" attributes are consulted."
1076
1094
msgstr ""
1095
+ "如果模組具有 ``__spec__`` 屬性,則使用規格中的資訊產生 repr。會參考 "
1096
+ "\" name\" 、\" loader\" 、\" origin\" 和 \" has_location\" 屬性。"
1077
1097
1078
1098
#: ../../reference/import.rst:592
1079
1099
msgid ""
1080
1100
"If the module has a ``__file__`` attribute, this is used as part of the "
1081
1101
"module's repr."
1082
- msgstr ""
1102
+ msgstr "如果模組具有 ``__file__`` 屬性,則會將其作為模組 repr 的一部分。 "
1083
1103
1084
1104
#: ../../reference/import.rst:595
1085
1105
msgid ""
1086
1106
"If the module has no ``__file__`` but does have a ``__loader__`` that is not "
1087
1107
"``None``, then the loader's repr is used as part of the module's repr."
1088
1108
msgstr ""
1109
+ "如果模組沒有 ``__file__`` 但有一個不為 ``None`` 的 ``__loader__`` ,則會將載"
1110
+ "入器的 repr 作為模組 repr 的一部分。"
1089
1111
1090
1112
#: ../../reference/import.rst:598
1091
1113
msgid "Otherwise, just use the module's ``__name__`` in the repr."
1092
- msgstr ""
1114
+ msgstr "否則,在 repr 中只使用模組的 ``__name__``。 "
1093
1115
1094
1116
#: ../../reference/import.rst:600
1095
1117
msgid ""
1096
1118
"Use of :meth:`!module_repr`, having been deprecated since Python 3.4, was "
1097
1119
"removed in Python 3.12 and is no longer called during the resolution of a "
1098
1120
"module's repr."
1099
1121
msgstr ""
1122
+ ":meth:`!module_repr` 自 Python 3.4 起被棄用,並在 Python 3.12 中移除,且不會"
1123
+ "在解析模組的 repr 時被呼叫。"
1100
1124
1101
1125
#: ../../reference/import.rst:608
1102
1126
msgid "Cached bytecode invalidation"
0 commit comments