@@ -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-12-11 22:16 +0800\n "
10+ "PO-Revision-Date : 2024-12-23 15:33 +0800\n "
1111"Last-Translator : Ken Cheng <ken71301@gmail.com>\n "
1212"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
1313"tw)\n "
@@ -1124,7 +1124,7 @@ msgstr ""
11241124
11251125#: ../../reference/import.rst:608
11261126msgid "Cached bytecode invalidation"
1127- msgstr ""
1127+ msgstr "被快取的位元組碼的無效化 "
11281128
11291129#: ../../reference/import.rst:610
11301130msgid ""
@@ -1135,6 +1135,10 @@ msgid ""
11351135"cache file by checking the stored metadata in the cache file against the "
11361136"source's metadata."
11371137msgstr ""
1138+ "在 Python 從 ``.pyc`` 檔案載入被快取的位元組碼之前,會檢查該快取是否與來源的 "
1139+ "``.py`` 檔案保持同步。預設情況下,Python 透過在寫入快取檔案時儲存來源檔案的最"
1140+ "後修改時間戳和大小來完成此操作。在執行時,引入系統會透過將快取檔案中儲存的元"
1141+ "資料 (metadata) 與來源檔案的元資料進行比對來驗證快取檔案。"
11381142
11391143#: ../../reference/import.rst:617
11401144msgid ""
@@ -1149,16 +1153,25 @@ msgid ""
11491153"Hash-based ``.pyc`` files validation behavior may be overridden with the :"
11501154"option:`--check-hash-based-pycs` flag."
11511155msgstr ""
1156+ "Python 還支援「基於雜湊」的快取檔案,這些檔案儲存來源檔案內容的雜湊值,而不是"
1157+ "其元資料。基於雜湊的 ``.pyc`` 檔案有兩種變體:需檢查和不需要檢查的。對於需檢"
1158+ "查的基於雜湊的 ``.pyc`` 檔案,Python 透過對來源檔案進行雜湊並將結果與快取檔案"
1159+ "中的雜湊進行比較來驗證快取檔案。如果發現需檢查的基於雜湊的快取檔案無效,"
1160+ "Python 會重新產生並寫入新的需檢查的基於雜湊的快取檔案。對於不需要檢查的基於雜"
1161+ "湊的 ``.pyc`` 檔案,只要檔案存在,Python 就假設快取檔案是有效的。可以使用 :"
1162+ "option:`--check-hash-based-pycs` 旗標覆蓋基於雜湊的 ``.pyc`` 檔案的驗證行為。"
11521163
11531164#: ../../reference/import.rst:628
11541165msgid ""
11551166"Added hash-based ``.pyc`` files. Previously, Python only supported timestamp-"
11561167"based invalidation of bytecode caches."
11571168msgstr ""
1169+ "新增了基於雜湊的 ``.pyc`` 檔案。此前,Python 只支援基於時間戳的位元組碼快取無"
1170+ "效化。"
11581171
11591172#: ../../reference/import.rst:634
11601173msgid "The Path Based Finder"
1161- msgstr ""
1174+ msgstr "基於路徑的尋檢器 "
11621175
11631176#: ../../reference/import.rst:639
11641177msgid ""
@@ -1168,13 +1181,19 @@ msgid ""
11681181"contains a list of :term:`path entries <path entry>`. Each path entry names "
11691182"a location to search for modules."
11701183msgstr ""
1184+ "如前所述,Python 附帶了幾個預設的元路徑尋檢器。其中之一稱為 :term:`path "
1185+ "based finder`\\ (\\ :class:`~importlib.machinery.PathFinder`\\ ),它搜尋 :"
1186+ "term:`import path`,該路徑包含一個 :term:`路徑條目 <path entry>` 的串列。每個"
1187+ "路徑條目都指定了一個用於搜尋模組的位置。"
11711188
11721189#: ../../reference/import.rst:645
11731190msgid ""
11741191"The path based finder itself doesn't know how to import anything. Instead, "
11751192"it traverses the individual path entries, associating each of them with a "
11761193"path entry finder that knows how to handle that particular kind of path."
11771194msgstr ""
1195+ "基於路徑的尋檢器本身並不知道如何引入任何東西。相反,它遍歷各個路徑條目,並將"
1196+ "每個路徑條目與一個知道如何處理該特定路徑類型的路徑條目尋檢器關聯起來。"
11781197
11791198#: ../../reference/import.rst:649
11801199msgid ""
@@ -1186,13 +1205,20 @@ msgid ""
11861205"also handle loading all of these file types (other than shared libraries) "
11871206"from zipfiles."
11881207msgstr ""
1208+ "預設的一組路徑條目尋檢器實作了在檔案系統中尋找模組的所有語意,包括處理特殊檔"
1209+ "案類型,例如 Python 原始程式碼檔案(``.py`` 檔案)、Python 位元組程式碼檔案"
1210+ "(``.pyc`` 檔案)以及共享函式庫(例如 ``.so`` 檔案)。當標準函式庫中的 :mod:"
1211+ "`zipimport` 模組支援時,預設的路徑條目尋檢器也能處理從壓縮檔案中載入這些檔案"
1212+ "類型(共享函式庫除外)。"
11891213
11901214#: ../../reference/import.rst:656
11911215msgid ""
11921216"Path entries need not be limited to file system locations. They can refer "
11931217"to URLs, database queries, or any other location that can be specified as a "
11941218"string."
11951219msgstr ""
1220+ "路徑條目不必侷限於檔案系統位置。它們可以參照 URL、資料庫查詢或任何可以作為字"
1221+ "串指定的位置。"
11961222
11971223#: ../../reference/import.rst:660
11981224msgid ""
@@ -1204,6 +1230,10 @@ msgid ""
12041230"protocol described below, which was then used to get a loader for the module "
12051231"from the web."
12061232msgstr ""
1233+ "基於路徑的尋檢器提供了額外的掛鉤和協定,讓你可以擴展和自定可搜尋的路徑條目類"
1234+ "型。例如,如果你希望支援將路徑條目作為網路 URLs,你可以撰寫一個實作 HTTP 語意"
1235+ "的掛鉤,用於在網路上尋找模組。這個掛鉤(一個可呼叫物件)會回傳一個支援下述協"
1236+ "定的 :term:`path entry finder` ,該尋檢器隨後用於從網路中獲取模組的載入器。"
12071237
12081238#: ../../reference/import.rst:668
12091239msgid ""
@@ -1215,6 +1245,11 @@ msgid ""
12151245"In particular, meta path finders operate at the beginning of the import "
12161246"process, as keyed off the :data:`sys.meta_path` traversal."
12171247msgstr ""
1248+ "提醒一句:本節與前一節都使用了 *尋檢器* 這個術語,並透過使用術語 :term:`meta "
1249+ "path finder` 和 :term:`path entry finder` 來區分它們。這兩種類型的尋檢器非常"
1250+ "相似,支援類似的協定,並在引入過程中以類似的方式運作,但請記住,它們之間有些"
1251+ "微的差異。特別是,元路徑尋檢器在引入過程的一開始運作,並通過 :data:`sys."
1252+ "meta_path` 的遍歷關閉 (key off)。"
12181253
12191254#: ../../reference/import.rst:676
12201255msgid ""
@@ -1223,6 +1258,9 @@ msgid ""
12231258"removed from :data:`sys.meta_path`, none of the path entry finder semantics "
12241259"would be invoked."
12251260msgstr ""
1261+ "相比之下,路徑條目尋檢器在某種意義上是基於路徑的尋檢器的一個實作細節。事實"
1262+ "上,如果基於路徑的尋檢器從 :data:`sys.meta_path` 中移除,路徑條目尋檢器的任何"
1263+ "語意都不會被調用。"
12261264
12271265#: ../../reference/import.rst:683
12281266msgid "Path entry finders"
0 commit comments