@@ -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-10-08 15:45 +0800\n "
10
+ "PO-Revision-Date : 2024-10-29 01:29 +0800\n "
11
11
"Last-Translator : Ken Cheng <ken71301@gmail.com>\n "
12
12
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
13
13
"tw)\n "
@@ -745,7 +745,7 @@ msgstr ""
745
745
746
746
#: ../../reference/import.rst:412
747
747
msgid "Loaders"
748
- msgstr ""
748
+ msgstr "載入器 "
749
749
750
750
#: ../../reference/import.rst:414
751
751
msgid ""
@@ -754,31 +754,41 @@ msgid ""
754
754
"method with a single argument, the module object to execute. Any value "
755
755
"returned from :meth:`~importlib.abc.Loader.exec_module` is ignored."
756
756
msgstr ""
757
+ "模組載入器提供了載入的關鍵功能:模組執行。引入機制會以單一引數(即要執行的模"
758
+ "組物件)呼叫 :meth:`importlib.abc.Loader.exec_module` 方法。任何從 :meth:"
759
+ "`~importlib.abc.Loader.exec_module` 回傳的值都會被忽略。"
757
760
758
761
#: ../../reference/import.rst:419
759
762
msgid "Loaders must satisfy the following requirements:"
760
- msgstr ""
763
+ msgstr "載入器必須滿足以下要求: "
761
764
762
765
#: ../../reference/import.rst:421
763
766
msgid ""
764
767
"If the module is a Python module (as opposed to a built-in module or a "
765
768
"dynamically loaded extension), the loader should execute the module's code "
766
769
"in the module's global name space (``module.__dict__``)."
767
770
msgstr ""
771
+ "如果模組是 Python 模組(而非內建模組或動態載入的擴充),載入器應在模組的全域"
772
+ "命名空間 (``module.__dict__``\\ ) 中執行該模組的程式碼。"
768
773
769
774
#: ../../reference/import.rst:425
770
775
msgid ""
771
776
"If the loader cannot execute the module, it should raise an :exc:"
772
777
"`ImportError`, although any other exception raised during :meth:`~importlib."
773
778
"abc.Loader.exec_module` will be propagated."
774
779
msgstr ""
780
+ "如果載入器無法執行該模組,應引發 :exc:`ImportError`。不過,在 :meth:"
781
+ "`~importlib.abc.Loader.exec_module` 中引發的任何其他例外也會被傳播。"
775
782
776
783
#: ../../reference/import.rst:429
777
784
msgid ""
778
785
"In many cases, the finder and loader can be the same object; in such cases "
779
786
"the :meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return "
780
787
"a spec with the loader set to ``self``."
781
788
msgstr ""
789
+ "在許多情況下,尋檢器和載入器可以是同一個物件;在這種情況下,:meth:"
790
+ "`~importlib.abc.MetaPathFinder.find_spec` 方法只需回傳一個載入器設為 "
791
+ "``self`` 的規格即可。"
782
792
783
793
#: ../../reference/import.rst:433
784
794
msgid ""
@@ -789,17 +799,23 @@ msgid ""
789
799
"the module object. If the method returns ``None``, the import machinery "
790
800
"will create the new module itself."
791
801
msgstr ""
802
+ "模組載入器可以選擇透過實作 :meth:`~importlib.abc.Loader.create_module` 方法,"
803
+ "在載入過程中建立模組物件。該方法接受一個引數,即模組規格,並回傳在載入過程中"
804
+ "要使用的新的模組物件。``create_module()`` 不需要在模組物件上設定任何屬性。如"
805
+ "果該方法回傳 ``None``,引入機制將自行建立新的模組。"
792
806
793
807
#: ../../reference/import.rst:440
794
808
msgid "The :meth:`~importlib.abc.Loader.create_module` method of loaders."
795
- msgstr ""
809
+ msgstr "載入器的 :meth:`~importlib.abc.Loader.create_module` 方法。 "
796
810
797
811
#: ../../reference/import.rst:443
798
812
msgid ""
799
813
"The :meth:`~importlib.abc.Loader.load_module` method was replaced by :meth:"
800
814
"`~importlib.abc.Loader.exec_module` and the import machinery assumed all the "
801
815
"boilerplate responsibilities of loading."
802
816
msgstr ""
817
+ ":meth:`~importlib.abc.Loader.load_module` 方法已被 :meth:`~importlib.abc."
818
+ "Loader.exec_module` 取代,引入機制已承擔所有載入的功能。"
803
819
804
820
#: ../../reference/import.rst:448
805
821
msgid ""
@@ -808,13 +824,18 @@ msgid ""
808
824
"also implement ``exec_module()``. However, ``load_module()`` has been "
809
825
"deprecated and loaders should implement ``exec_module()`` instead."
810
826
msgstr ""
827
+ "為了與現有的載入器相容,引入機制會在載入器未實作 ``exec_module()`` 且存在 "
828
+ "``load_module()`` 方法時使用該方法。然而,``load_module()`` 已被棄用,載入器"
829
+ "應改為實作 ``exec_module()``。"
811
830
812
831
#: ../../reference/import.rst:453
813
832
msgid ""
814
833
"The ``load_module()`` method must implement all the boilerplate loading "
815
834
"functionality described above in addition to executing the module. All the "
816
835
"same constraints apply, with some additional clarification:"
817
836
msgstr ""
837
+ "``load_module()`` 方法除了執行模組外,還必須實作上述全部的模板載入功能。所有"
838
+ "相同的限制依然適用,並且還有一些額外的說明:"
818
839
819
840
#: ../../reference/import.rst:457
820
841
msgid ""
@@ -824,35 +845,48 @@ msgid ""
824
845
"exist in :data:`sys.modules`, the loader must create a new module object and "
825
846
"add it to :data:`sys.modules`."
826
847
msgstr ""
848
+ "如果 :data:`sys.modules` 中已存在具有給定名稱的模組物件,載入器必須使用該模組"
849
+ "(否則 :func:`importlib.reload` 將無法正常運作)。如果命名模組不存在於 :data:"
850
+ "`sys.modules` 中,載入器必須建立一個新的模組物件並將其新增至 :data:`sys."
851
+ "modules`。"
827
852
828
853
#: ../../reference/import.rst:463
829
854
msgid ""
830
855
"The module *must* exist in :data:`sys.modules` before the loader executes "
831
856
"the module code, to prevent unbounded recursion or multiple loading."
832
857
msgstr ""
858
+ "在載入器執行模組程式碼之前,該模組\\ *必須*\\ 已存在於 :data:`sys.modules` "
859
+ "中,以防止無限遞迴或多次載入。"
833
860
834
861
#: ../../reference/import.rst:467
835
862
msgid ""
836
863
"If loading fails, the loader must remove any modules it has inserted into :"
837
864
"data:`sys.modules`, but it must remove **only** the failing module(s), and "
838
865
"only if the loader itself has loaded the module(s) explicitly."
839
866
msgstr ""
867
+ "如果載入失敗,載入器必須移除已經插入到 :data:`sys.modules` 中的任何模組,但"
868
+ "\\ **只能**\\ 移除失敗的模組(們),且僅在載入器本身明確載入這些模組時才需移"
869
+ "除。"
840
870
841
871
#: ../../reference/import.rst:472
842
872
msgid ""
843
873
"A :exc:`DeprecationWarning` is raised when ``exec_module()`` is defined but "
844
874
"``create_module()`` is not."
845
875
msgstr ""
876
+ "當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引發 :exc:"
877
+ "`DeprecationWarning`。"
846
878
847
879
#: ../../reference/import.rst:476
848
880
msgid ""
849
881
"An :exc:`ImportError` is raised when ``exec_module()`` is defined but "
850
882
"``create_module()`` is not."
851
883
msgstr ""
884
+ "當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引發 :exc:"
885
+ "`ImportError`。"
852
886
853
887
#: ../../reference/import.rst:480
854
888
msgid "Use of ``load_module()`` will raise :exc:`ImportWarning`."
855
- msgstr ""
889
+ msgstr "使用 ``load_module()`` 將引發 :exc:`ImportWarning`。 "
856
890
857
891
#: ../../reference/import.rst:484
858
892
msgid "Submodules"
0 commit comments