Skip to content

Commit 97b5c58

Browse files
committed
feat: to rst:241
1 parent e6ae880 commit 97b5c58

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

reference/import.po

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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-10-03 12:02+0800\n"
10+
"PO-Revision-Date: 2024-10-03 12:18+0800\n"
1111
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1313
"tw)\n"
@@ -353,7 +353,7 @@ msgid ""
353353
"`ModuleNotFoundError`."
354354
msgstr ""
355355
":data:`sys.modules` 是可寫入的。刪除一個鍵可能不會銷毀相關聯的模組(因為其他"
356-
"模組可能持有對它的參照),但會使該命名模組的快取條目失效,導致 Python 在下一"
356+
"模組可能持有對它的參照),但會使指定的模組的快取條目失效,導致 Python 在下一"
357357
"次引入該模組時重新搜尋。也可以將鍵賦值為 ``None``,這會強制下一次引入該模組時"
358358
"引發 :exc:`ModuleNotFoundError`。"
359359

@@ -366,13 +366,13 @@ msgid ""
366366
"module contents by rerunning the module's code."
367367
msgstr ""
368368
"但請注意,如果你保留了對模組物件的參照,並在 :data:`sys.modules` 中使其快取條"
369-
"目失效,然後重新引入該命名模組,這兩個模組物件將\\ *不會*\\ 相同。相比之下,:"
369+
"目失效,然後重新引入指定的模組,這兩個模組物件將\\ *不會*\\ 相同。相比之下,:"
370370
"func:`importlib.reload` 會重用\\ *相同的*\\ 模組物件,並通過重新執行模組的程"
371371
"式碼來簡單地重新初始化模組內容。"
372372

373373
#: ../../reference/import.rst:208
374374
msgid "Finders and loaders"
375-
msgstr ""
375+
msgstr "尋檢器與載入器"
376376

377377
#: ../../reference/import.rst:215
378378
msgid ""
@@ -385,6 +385,11 @@ msgid ""
385385
"they return themselves when they find that they can load the requested "
386386
"module."
387387
msgstr ""
388+
"如果在 :data:`sys.modules` 中找不到指定的模組,則會調用 Python 的引入協定來尋"
389+
"找並載入該模組。這個協定由兩個概念性物件組成,:term:`尋檢器 <finder>` 和\\ :"
390+
"term:`載入器 <loader>`。尋檢器的任務是使用其已知的策略來確定是否能找到命名模"
391+
"組。實作這兩個介面的物件稱為\\ :term:`引入器 <importer>` ——當它們發現可以載入"
392+
"所請求的模組時,會回傳它們自己。"
388393

389394
#: ../../reference/import.rst:223
390395
msgid ""
@@ -395,12 +400,18 @@ msgid ""
395400
"system paths or zip files. It can also be extended to search for any "
396401
"locatable resource, such as those identified by URLs."
397402
msgstr ""
403+
"Python 包含多個預設的尋檢器和引入器。第一個尋檢器知道如何定位內建模組,第二個"
404+
"尋檢器知道如何定位凍結模組。第三個預設尋檢器會在\\ :term:`引入路徑 <import "
405+
"path>` 中搜尋模組。:term:`引入路徑 <import path>`是一個位置的列表,這些位置可"
406+
"能是檔案系統路徑或壓縮檔案,也可以擴展以搜尋任何可定位的資源,例如由 URL 識別"
407+
"的資源。"
398408

399409
#: ../../reference/import.rst:230
400410
msgid ""
401411
"The import machinery is extensible, so new finders can be added to extend "
402412
"the range and scope of module searching."
403413
msgstr ""
414+
"引入機制是可擴展的,因此可以增加新的尋檢器來擴展模組搜尋的範圍和作用域。"
404415

405416
#: ../../reference/import.rst:233
406417
msgid ""
@@ -409,20 +420,28 @@ msgid ""
409420
"related information, which the import machinery then uses when loading the "
410421
"module."
411422
msgstr ""
423+
"尋檢器實際上不會載入模組。如果它們能找到指定的模組,它們會回傳一個\\ :dfn:`模"
424+
"組規格`,這是一個模組的引入相關資訊的封裝,引入機制會在載入模組時使用這些資"
425+
"訊。"
412426

413427
#: ../../reference/import.rst:237
414428
msgid ""
415429
"The following sections describe the protocol for finders and loaders in more "
416430
"detail, including how you can create and register new ones to extend the "
417431
"import machinery."
418432
msgstr ""
433+
"以下各節將更詳細地描述尋檢器和載入器的協定,包括如何建立和註冊新的尋檢器和載"
434+
"入器來擴展引入機制。"
419435

420436
#: ../../reference/import.rst:241
421437
msgid ""
422438
"In previous versions of Python, finders returned :term:`loaders <loader>` "
423439
"directly, whereas now they return module specs which *contain* loaders. "
424440
"Loaders are still used during import but have fewer responsibilities."
425441
msgstr ""
442+
"Python 在之前的版本中,尋檢器會直接回傳\\ :term:`載入器 <loader>`,而現在它們"
443+
"回傳的是\\ *包含*\\ 載入器的模組規格。載入器仍在引入過程中使用,但其責任減少"
444+
"了。"
426445

427446
#: ../../reference/import.rst:247
428447
msgid "Import hooks"

0 commit comments

Comments
 (0)