@@ -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-12-11 22:16 +0800\n "
10
+ "PO-Revision-Date : 2024-12-23 15:33 +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 "
@@ -1124,7 +1124,7 @@ msgstr ""
1124
1124
1125
1125
#: ../../reference/import.rst:608
1126
1126
msgid "Cached bytecode invalidation"
1127
- msgstr ""
1127
+ msgstr "被快取的位元組碼的無效化 "
1128
1128
1129
1129
#: ../../reference/import.rst:610
1130
1130
msgid ""
@@ -1135,6 +1135,10 @@ msgid ""
1135
1135
"cache file by checking the stored metadata in the cache file against the "
1136
1136
"source's metadata."
1137
1137
msgstr ""
1138
+ "在 Python 從 ``.pyc`` 檔案載入被快取的位元組碼之前,會檢查該快取是否與來源的 "
1139
+ "``.py`` 檔案保持同步。預設情況下,Python 透過在寫入快取檔案時儲存來源檔案的最"
1140
+ "後修改時間戳和大小來完成此操作。在執行時,引入系統會透過將快取檔案中儲存的元"
1141
+ "資料 (metadata) 與來源檔案的元資料進行比對來驗證快取檔案。"
1138
1142
1139
1143
#: ../../reference/import.rst:617
1140
1144
msgid ""
@@ -1149,16 +1153,25 @@ msgid ""
1149
1153
"Hash-based ``.pyc`` files validation behavior may be overridden with the :"
1150
1154
"option:`--check-hash-based-pycs` flag."
1151
1155
msgstr ""
1156
+ "Python 還支援「基於雜湊」的快取檔案,這些檔案儲存來源檔案內容的雜湊值,而不是"
1157
+ "其元資料。基於雜湊的 ``.pyc`` 檔案有兩種變體:需檢查和不需要檢查的。對於需檢"
1158
+ "查的基於雜湊的 ``.pyc`` 檔案,Python 透過對來源檔案進行雜湊並將結果與快取檔案"
1159
+ "中的雜湊進行比較來驗證快取檔案。如果發現需檢查的基於雜湊的快取檔案無效,"
1160
+ "Python 會重新產生並寫入新的需檢查的基於雜湊的快取檔案。對於不需要檢查的基於雜"
1161
+ "湊的 ``.pyc`` 檔案,只要檔案存在,Python 就假設快取檔案是有效的。可以使用 :"
1162
+ "option:`--check-hash-based-pycs` 旗標覆蓋基於雜湊的 ``.pyc`` 檔案的驗證行為。"
1152
1163
1153
1164
#: ../../reference/import.rst:628
1154
1165
msgid ""
1155
1166
"Added hash-based ``.pyc`` files. Previously, Python only supported timestamp-"
1156
1167
"based invalidation of bytecode caches."
1157
1168
msgstr ""
1169
+ "新增了基於雜湊的 ``.pyc`` 檔案。此前,Python 只支援基於時間戳的位元組碼快取無"
1170
+ "效化。"
1158
1171
1159
1172
#: ../../reference/import.rst:634
1160
1173
msgid "The Path Based Finder"
1161
- msgstr ""
1174
+ msgstr "基於路徑的尋檢器 "
1162
1175
1163
1176
#: ../../reference/import.rst:639
1164
1177
msgid ""
@@ -1168,13 +1181,19 @@ msgid ""
1168
1181
"contains a list of :term:`path entries <path entry>`. Each path entry names "
1169
1182
"a location to search for modules."
1170
1183
msgstr ""
1184
+ "如前所述,Python 附帶了幾個預設的元路徑尋檢器。其中之一稱為 :term:`path "
1185
+ "based finder`\\ (\\ :class:`~importlib.machinery.PathFinder`\\ ),它搜尋 :"
1186
+ "term:`import path`,該路徑包含一個 :term:`路徑條目 <path entry>` 的串列。每個"
1187
+ "路徑條目都指定了一個用於搜尋模組的位置。"
1171
1188
1172
1189
#: ../../reference/import.rst:645
1173
1190
msgid ""
1174
1191
"The path based finder itself doesn't know how to import anything. Instead, "
1175
1192
"it traverses the individual path entries, associating each of them with a "
1176
1193
"path entry finder that knows how to handle that particular kind of path."
1177
1194
msgstr ""
1195
+ "基於路徑的尋檢器本身並不知道如何引入任何東西。相反,它遍歷各個路徑條目,並將"
1196
+ "每個路徑條目與一個知道如何處理該特定路徑類型的路徑條目尋檢器關聯起來。"
1178
1197
1179
1198
#: ../../reference/import.rst:649
1180
1199
msgid ""
@@ -1186,13 +1205,20 @@ msgid ""
1186
1205
"also handle loading all of these file types (other than shared libraries) "
1187
1206
"from zipfiles."
1188
1207
msgstr ""
1208
+ "預設的一組路徑條目尋檢器實作了在檔案系統中尋找模組的所有語意,包括處理特殊檔"
1209
+ "案類型,例如 Python 原始程式碼檔案(``.py`` 檔案)、Python 位元組程式碼檔案"
1210
+ "(``.pyc`` 檔案)以及共享函式庫(例如 ``.so`` 檔案)。當標準函式庫中的 :mod:"
1211
+ "`zipimport` 模組支援時,預設的路徑條目尋檢器也能處理從壓縮檔案中載入這些檔案"
1212
+ "類型(共享函式庫除外)。"
1189
1213
1190
1214
#: ../../reference/import.rst:656
1191
1215
msgid ""
1192
1216
"Path entries need not be limited to file system locations. They can refer "
1193
1217
"to URLs, database queries, or any other location that can be specified as a "
1194
1218
"string."
1195
1219
msgstr ""
1220
+ "路徑條目不必侷限於檔案系統位置。它們可以參照 URL、資料庫查詢或任何可以作為字"
1221
+ "串指定的位置。"
1196
1222
1197
1223
#: ../../reference/import.rst:660
1198
1224
msgid ""
@@ -1204,6 +1230,10 @@ msgid ""
1204
1230
"protocol described below, which was then used to get a loader for the module "
1205
1231
"from the web."
1206
1232
msgstr ""
1233
+ "基於路徑的尋檢器提供了額外的掛鉤和協定,讓你可以擴展和自定可搜尋的路徑條目類"
1234
+ "型。例如,如果你希望支援將路徑條目作為網路 URLs,你可以撰寫一個實作 HTTP 語意"
1235
+ "的掛鉤,用於在網路上尋找模組。這個掛鉤(一個可呼叫物件)會回傳一個支援下述協"
1236
+ "定的 :term:`path entry finder` ,該尋檢器隨後用於從網路中獲取模組的載入器。"
1207
1237
1208
1238
#: ../../reference/import.rst:668
1209
1239
msgid ""
@@ -1215,6 +1245,11 @@ msgid ""
1215
1245
"In particular, meta path finders operate at the beginning of the import "
1216
1246
"process, as keyed off the :data:`sys.meta_path` traversal."
1217
1247
msgstr ""
1248
+ "提醒一句:本節與前一節都使用了 *尋檢器* 這個術語,並透過使用術語 :term:`meta "
1249
+ "path finder` 和 :term:`path entry finder` 來區分它們。這兩種類型的尋檢器非常"
1250
+ "相似,支援類似的協定,並在引入過程中以類似的方式運作,但請記住,它們之間有些"
1251
+ "微的差異。特別是,元路徑尋檢器在引入過程的一開始運作,並通過 :data:`sys."
1252
+ "meta_path` 的遍歷關閉 (key off)。"
1218
1253
1219
1254
#: ../../reference/import.rst:676
1220
1255
msgid ""
@@ -1223,6 +1258,9 @@ msgid ""
1223
1258
"removed from :data:`sys.meta_path`, none of the path entry finder semantics "
1224
1259
"would be invoked."
1225
1260
msgstr ""
1261
+ "相比之下,路徑條目尋檢器在某種意義上是基於路徑的尋檢器的一個實作細節。事實"
1262
+ "上,如果基於路徑的尋檢器從 :data:`sys.meta_path` 中移除,路徑條目尋檢器的任何"
1263
+ "語意都不會被調用。"
1226
1264
1227
1265
#: ../../reference/import.rst:683
1228
1266
msgid "Path entry finders"
0 commit comments