@@ -1075,7 +1075,7 @@ msgid ""
10751075"attributes set above, and in the module's spec, you can more explicitly "
10761076"control the repr of module objects."
10771077msgstr ""
1078- "預設情況下,所有模組都有可用的 repr,然而,根據上述設定及模組規格中的屬性 ,你"
1078+ "預設情況下,所有模組都有可用的 repr,然而根據上述設定及模組規格中的屬性 ,你"
10791079"可以更明確地控制模組物件的 repr。"
10801080
10811081#: ../../reference/import.rst:581
@@ -1087,7 +1087,7 @@ msgid ""
10871087"``module.__file__``, and ``module.__loader__`` as input into the repr, with "
10881088"defaults for whatever information is missing."
10891089msgstr ""
1090- "如果模組具有規格(\\ ``__spec__``\\ ),引入機制將嘗試從規格中產生 repr。如果"
1090+ "如果模組具有規格(``__spec__``),引入機制將嘗試從規格中產生 repr。如果"
10911091"失敗或沒有規格,引入系統將使用模組上可用的資訊製作一個預設的 repr。它會嘗試使"
10921092"用 ``module.__name__``、``module.__file__`` 和 ``module.__loader__`` 作為 "
10931093"repr 的輸入,並為缺少的資訊提供預設值。"
@@ -1147,7 +1147,7 @@ msgid ""
11471147msgstr ""
11481148"在 Python 從 ``.pyc`` 檔案載入被快取的位元組碼之前,會檢查該快取是否與來源的 "
11491149"``.py`` 檔案保持同步。預設情況下,Python 透過在寫入快取檔案時儲存來源檔案的最"
1150- "後修改時間戳和大小來完成此操作。在執行時 ,引入系統會透過將快取檔案中儲存的元"
1150+ "後修改時間戳和大小來完成此操作。在 runtime ,引入系統會透過將快取檔案中儲存的元"
11511151"資料 (metadata) 與來源檔案的元資料進行比對來驗證快取檔案。"
11521152
11531153#: ../../reference/import.rst:619
@@ -1193,8 +1193,8 @@ msgid ""
11931193"names a location to search for modules."
11941194msgstr ""
11951195"如前所述,Python 附帶了幾個預設的元路徑尋檢器。其中之一稱為 :term:`path "
1196- "based finder`\\ (\\ :class:`~importlib.machinery.PathFinder`\\ ),它搜"
1197- "尋 :term:`import path`,該路徑包含一個 :term:`路徑條目 <path entry>` 的串列。"
1196+ "based finder`\\ (:class:`~importlib.machinery.PathFinder`),它搜"
1197+ "尋 :term:`import path`,該路徑包含一個\\ :term:`路徑條目 <path entry>`\\ 的串列。"
11981198"每個路徑條目都指定了一個用於搜尋模組的位置。"
11991199
12001200#: ../../reference/import.rst:647
@@ -1241,10 +1241,10 @@ msgid ""
12411241"protocol described below, which was then used to get a loader for the module "
12421242"from the web."
12431243msgstr ""
1244- "基於路徑的尋檢器提供了額外的掛鉤和協定,讓你可以擴展和自定可搜尋的路徑條目類 "
1244+ "基於路徑的尋檢器提供了額外的掛鉤和協定,讓你可以擴展和自訂可搜尋的路徑條目類 "
12451245"型。例如,如果你希望支援將路徑條目作為網路 URLs,你可以撰寫一個實作 HTTP 語意"
12461246"的掛鉤,用於在網路上尋找模組。這個掛鉤(一個可呼叫物件)會回傳一個支援下述協"
1247- "定的 :term:`path entry finder` ,該尋檢器隨後用於從網路中獲取模組的載入器 。"
1247+ "定的 :term:`path entry finder` ,該尋檢器隨後用於從網路中取得模組的載入器 。"
12481248
12491249#: ../../reference/import.rst:670
12501250msgid ""
@@ -1258,8 +1258,8 @@ msgid ""
12581258msgstr ""
12591259"提醒一句:本節與前一節都使用了 *尋檢器* 這個術語,並透過使用術語 :term:`meta "
12601260"path finder` 和 :term:`path entry finder` 來區分它們。這兩種類型的尋檢器非常"
1261- "相似,支援類似的協定 ,並在引入過程中以類似的方式運作,但請記住,它們之間有些 "
1262- "微的差異 。特別是,元路徑尋檢器在引入過程的一開始運作,並通"
1261+ "相似,它們支援類似的協定 ,並在引入過程中以類似的方式運作,但請記住,它們之間仍有些 "
1262+ "許的差異 。特別是,元路徑尋檢器在引入過程的一開始運作,並通"
12631263"過 :data:`sys.meta_path` 的遍歷關閉 (key off)。"
12641264
12651265#: ../../reference/import.rst:678
@@ -1271,7 +1271,7 @@ msgid ""
12711271msgstr ""
12721272"相比之下,路徑條目尋檢器在某種意義上是基於路徑的尋檢器的一個實作細節。事實"
12731273"上,如果基於路徑的尋檢器從 :data:`sys.meta_path` 中移除,路徑條目尋檢器的任何"
1274- "語意都不會被調用 。"
1274+ "語意都不會被叫用 。"
12751275
12761276#: ../../reference/import.rst:685
12771277msgid "Path entry finders"
@@ -1339,10 +1339,10 @@ msgid ""
13391339"attribute for an import within that package. If the ``path`` argument is "
13401340"``None``, this indicates a top level import and :data:`sys.path` is used."
13411341msgstr ""
1342- ":term:`path based finder` 是 :term:`meta path finder`,因此引入機制會如前所"
1343- "述,透過呼叫基於路徑的尋檢器 "
1342+ ":term:`path based finder` 也是一種 :term:`meta path finder`,因此引入機制會如前所"
1343+ "述般透過呼叫基於路徑的尋檢器 "
13441344"的 :meth:`~importlib.machinery.PathFinder.find_spec` 方法來開"
1345- "始 :term:`import path` 的搜尋。當提 "
1345+ "始 :term:`import path` 的搜尋。當有提 "
13461346"供 :meth:`~importlib.machinery.PathFinder.find_spec` 的 ``path`` 引數時,它會"
13471347"是一個要遍歷的字串路徑 list——通常是在套件內引入時使用該套件的 ``__path__`` 屬"
13481348"性。如果 ``path`` 引數為 ``None``,則表示為頂層引入並使用 :data:`sys.path`。"
@@ -1364,7 +1364,7 @@ msgid ""
13641364msgstr ""
13651365"基於路徑的尋檢器會遍歷搜尋路徑中的每個條目,並為每個條目尋找適當"
13661366"的 :term:`path entry finder` (:class:`~importlib.abc.PathEntryFinder`)。由於"
1367- "這可能是昂貴的操作(例如此搜尋可能會有 ``stat()`` 呼叫的額外負擔 ),基於路徑"
1367+ "這可能是昂貴的操作(例如此搜尋可能會有 ``stat()`` 呼叫的額外開銷 ),基於路徑"
13681368"的尋檢器會維護一個將路徑條目對映到路徑條目尋檢器的快取。此快取存放"
13691369"於 :data:`sys.path_importer_cache`\\ (儘管名稱如此,該快取實際上儲存的是尋檢"
13701370"器物件,而非僅限於 :term:`importer` 物件)。如此一來,針對特定 :term:`path "
@@ -1451,7 +1451,7 @@ msgid ""
14511451"contribute portions to namespace packages, path entry finders must implement "
14521452"the :meth:`~importlib.abc.PathEntryFinder.find_spec` method."
14531453msgstr ""
1454- "為了支援模組與已初始化套件的引入,並能為命名空間套件貢獻部分 ,路徑條目尋檢器"
1454+ "為了支援模組與已初始化套件的引入,並能為命名空間套件提供部分組成 ,路徑條目尋檢器"
14551455"必須實作 :meth:`~importlib.abc.PathEntryFinder.find_spec` 方法。"
14561456
14571457#: ../../reference/import.rst:781
@@ -1527,8 +1527,8 @@ msgid ""
15271527"entry finder, the import system will always call ``find_loader()`` in "
15281528"preference to ``find_module()``."
15291529msgstr ""
1530- "路徑條目尋檢器上的 ``find_module()`` 方法已被棄用,因為它無法讓路徑條目尋檢器 "
1531- "為命名空間套件貢獻部分 。若路徑條目尋檢器同時存在 ``find_loader()`` 與 "
1530+ "路徑條目尋檢器上的 ``find_module()`` 方法已被棄用,因為它不允許路徑條目尋檢器 "
1531+ "為命名空間套件只提供部分組成 。若路徑條目尋檢器同時存在 ``find_loader()`` 與 "
15321532"``find_module()``,引入系統會一律優先呼叫 ``find_loader()``。"
15331533
15341534#: ../../reference/import.rst:819
@@ -1563,7 +1563,7 @@ msgid ""
15631563"builtin :func:`__import__` function may be sufficient."
15641564msgstr ""
15651565"如果可以只改變 import 陳述式的行為,而不影響其他存取引入系統的 API,那麼替換"
1566- "內建的\\ :func:`__import__` 函式可能就足夠了。"
1566+ "內建的 :func:`__import__` 函式可能就足夠了。"
15671567
15681568#: ../../reference/import.rst:839
15691569msgid ""
@@ -1739,7 +1739,7 @@ msgid ""
17391739"in :mod:`__main__`."
17401740msgstr ""
17411741"請注意,在最後一種情況下,``__main__.__spec__`` 一律為 ``None``,*即使* 該檔"
1742- "案技術上可直接作為模組引入也一樣 。若希望在 :mod:`__main__` 中取得有效的模組後"
1742+ "案在技術上可直接作為模組引入也一樣 。若希望在 :mod:`__main__` 中取得有效的模組後"
17431743"設資料,請使用 :option:`-m` 選項。"
17441744
17451745#: ../../reference/import.rst:927
@@ -1752,7 +1752,7 @@ msgid ""
17521752msgstr ""
17531753"另請注意,即使 ``__main__`` 對應到可引入的模組,且 ``__main__.__spec__`` 也已"
17541754"相應設定,它們仍被視為 *不同* 的模組。這是因為由 ``if __name__ == "
1755- "\" __main__\" :`` 檢查所保護的程式碼區塊 ,只會在該模組用來填入 ``__main__`` 命"
1755+ "\" __main__\" :`` 檢查所包住的程式碼區塊 ,只會在該模組用來填入 ``__main__`` 命"
17561756"名空間時執行,而不會在一般引入時執行。"
17571757
17581758#: ../../reference/import.rst:935
@@ -1775,31 +1775,31 @@ msgid ""
17751775"The original specification for :data:`sys.meta_path` was :pep:`302`, with "
17761776"subsequent extension in :pep:`420`."
17771777msgstr ""
1778- ":data:`sys.meta_path` 的原始規範是 :pep:`302`,後續在 :pep:`420` 中擴充。"
1778+ ":data:`sys.meta_path` 的原始規格是 :pep:`302`,後續在 :pep:`420` 中擴充。"
17791779
17801780#: ../../reference/import.rst:945
17811781msgid ""
17821782":pep:`420` introduced :term:`namespace packages <namespace package>` for "
17831783"Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as "
17841784"an alternative to :meth:`!find_module`."
17851785msgstr ""
1786- ":pep:`420` 在 Python 3.3 中引入了 :term:`namespace packages <namespace "
1786+ ":pep:`420` 在 Python 3.3 中引進了 :term:`namespace packages <namespace "
17871787"package>`。:pep:`420` 也引入了 :meth:`!find_loader` 協定,作為 :meth:`!"
17881788"find_module` 的替代方案。"
17891789
17901790#: ../../reference/import.rst:949
17911791msgid ""
17921792":pep:`366` describes the addition of the ``__package__`` attribute for "
17931793"explicit relative imports in main modules."
1794- msgstr ":pep:`366` 描述了在主模組中為明確的相對引入加入 ``__package__`` 屬性。"
1794+ msgstr ":pep:`366` 描述了在主模組中的明確相對引入加上 ``__package__`` 屬性。"
17951795
17961796#: ../../reference/import.rst:952
17971797msgid ""
17981798":pep:`328` introduced absolute and explicit relative imports and initially "
17991799"proposed ``__name__`` for semantics :pep:`366` would eventually specify for "
18001800"``__package__``."
18011801msgstr ""
1802- ":pep:`328` 引入了絕對引入與明確的相對引入 ,並最初提出以 ``__name__`` 來表"
1802+ ":pep:`328` 引進了絕對引入與明確的相對引入 ,並最初提出以 ``__name__`` 來表"
18031803"示 :pep:`366` 最終為 ``__package__`` 指定的語意。"
18041804
18051805#: ../../reference/import.rst:956
@@ -1814,7 +1814,7 @@ msgid ""
18141814"of several APIs in the import system and also addition of new methods to "
18151815"finders and loaders."
18161816msgstr ""
1817- ":pep:`451` 增加了在 spec 物件中封裝每個模組的引入狀態 。它也將載入器的大部分樣"
1817+ ":pep:`451` 增加了在 spec 物件中封裝個別模組的引入狀態 。它也將載入器的大部分樣"
18181818"板責任移回引入機制。這些變更讓引入系統中的多個 API 得以棄用,並新增尋檢器與載"
18191819"入器的方法。"
18201820
0 commit comments