@@ -510,6 +510,14 @@ msgid ""
510510"return. :func:`importlib.util.spec_from_loader` may be useful for "
511511"implementing concrete ``MetaPathFinders``."
512512msgstr ""
513+ "指定されたモジュールに対応する :term:`スペック <module spec>` を検索する抽象"
514+ "メソッド。もしこれがトップレベルのインポートなら、 *path* は ``None`` です。"
515+ "そうでなければ、これはサブパッケージまたはモジュールのための検索で、 *path* "
516+ "は親パッケージの :attr:`__path__` の値です。スペックが見つからなければ "
517+ "``None`` が返されます。 ``target`` は、渡されてきたならモジュールオブジェクト"
518+ "です。これはファインダーがどのようなスペックを返せばよいか推測するために使用"
519+ "します。具体的な ``MetaPathFinders`` を実装するためには :func:`importlib."
520+ "util.spec_from_loader` が便利かもしれません。"
513521
514522#: ../../library/importlib.rst:284
515523msgid ""
@@ -585,6 +593,13 @@ msgid ""
585593"func:`importlib.util.spec_from_loader` may be useful for implementing "
586594"concrete ``PathEntryFinders``."
587595msgstr ""
596+ "指定されたモジュールに対応する :term:`スペック <module spec>` を検索する抽象"
597+ "メソッド。ファインダーは、割り当てられている :term:`パス・エントリー <path "
598+ "entry>` 内のモジュールだけを検索します。スペックが見つからなければ ``None`` "
599+ "が返されます。 ``target`` は、渡されてきたならモジュールオブジェクトです。こ"
600+ "れはファインダーがどのようなスペックを返せばよいか推測するために使用します。"
601+ "具体的な ``PathEntryFinders`` を実装するためには :func:`importlib.util."
602+ "spec_from_loader` が便利かもしれません。"
588603
589604#: ../../library/importlib.rst:335
590605msgid ""
@@ -1031,6 +1046,9 @@ msgid ""
10311046"false value otherwise. :exc:`ImportError` is raised if the :term:`loader` "
10321047"cannot find the module."
10331048msgstr ""
1049+ "モジュールがパッケージであれば True を返し、そうでなければ False を返すオプ"
1050+ "ションのメソッドです。 :term:`ローダー <loader>` がモジュールを見つけられな"
1051+ "かったなら :exc:`ImportError` が送出されます。"
10341052
10351053#: ../../library/importlib.rst:624
10361054msgid "Create a code object from Python source."
@@ -1672,6 +1690,8 @@ msgid ""
16721690":term:`Finder <finder>` for modules declared in the Windows registry. This "
16731691"class implements the :class:`importlib.abc.MetaPathFinder` ABC."
16741692msgstr ""
1693+ "Windows レジストリで宣言されたモジュールの :term:`finder <finder>` です。この"
1694+ "クラスは :class:`importlib.abc.MetaPathFinder` 抽象基底クラスを実装します。"
16751695
16761696#: ../../library/importlib.rst:1098
16771697msgid ""
@@ -1688,6 +1708,9 @@ msgid ""
16881708"attributes. This class implements the :class:`importlib.abc.MetaPathFinder` "
16891709"ABC."
16901710msgstr ""
1711+ ":data:`sys.path` およびパッケージの ``__path__`` 属性の :term:`Finder "
1712+ "<finder>` です。このクラスは :class:`importlib.abc.MetaPathFinder` 抽象基底ク"
1713+ "ラスを実装します。"
16911714
16921715#: ../../library/importlib.rst:1113
16931716msgid ""
@@ -1846,7 +1869,7 @@ msgstr "ソースファイルへのパスです。"
18461869
18471870#: ../../library/importlib.rst:1226
18481871msgid "Return ``True`` if :attr:`path` appears to be for a package."
1849- msgstr ""
1872+ msgstr ":attr:`path` がパッケージを表すとき ``True`` を返します。 "
18501873
18511874#: ../../library/importlib.rst:1230
18521875msgid ""
@@ -2116,6 +2139,15 @@ msgid ""
21162139"cpython-32.opt-2.pyc``. The string representation of *optimization* can only "
21172140"be alphanumeric, else :exc:`ValueError` is raised."
21182141msgstr ""
2142+ "*optimization* パラメータは、バイトコードファイルの最適化レベルを指定するため"
2143+ "に使われます。空文字列は最適化しないことを表します。したがって、 "
2144+ "*optimization* が ``''`` のとき ``/foo/bar/baz.py`` に対して ``/foo/bar/"
2145+ "__pycache__/baz.cpython-32.pyc`` というバイトコードパスが返ります。 ``None`` "
2146+ "にするとインタープリタの最適化レベルが使われます。それ以外では値の文字列表現"
2147+ "が使われます。したがって、 *optimization* が ``2`` のとき ``/foo/bar/baz."
2148+ "py`` に対して ``/foo/bar/__pycache__/baz.cpython-32.opt-2.pyc`` というバイト"
2149+ "コードパスが返ります。 *optimization* の文字列表現は英数字だけが可能で、そう"
2150+ "でなければ :exc:`ValueError` が上げられます。"
21192151
21202152#: ../../library/importlib.rst:1447
21212153msgid ""
@@ -2153,6 +2185,12 @@ msgid ""
21532185"format, a :exc:`ValueError` is raised. If :attr:`sys.implementation."
21542186"cache_tag` is not defined, :exc:`NotImplementedError` is raised."
21552187msgstr ""
2188+ ":pep:`3147` ファイル名への *path* が与えられると、関連するソースコードのファ"
2189+ "イルパスを返します。例えば、 *path* が ``/foo/bar/__pycache__/baz.cpython-32."
2190+ "pyc`` なら、返��れるパスは ``/foo/bar/baz.py`` になります。 *path* は存在する"
2191+ "必要はありませんが、 :pep:`3147` または :pep:`488` フォーマットに一致しない場"
2192+ "合は :exc:`ValueError` が送出されます。 :attr:`sys.implementation.cache_tag` "
2193+ "が定義されていない場合、 :exc:`NotImplementedError` が送出されます。"
21562194
21572195#: ../../library/importlib.rst:1480
21582196msgid ""
@@ -2174,6 +2212,9 @@ msgid ""
21742212"allows for usage such as ``importlib.util.resolve_name('sys', __spec__."
21752213"parent)`` without doing a check to see if the **package** argument is needed."
21762214msgstr ""
2215+ "**name** の先頭にドットがなければ、単に **name** が返されます。これにより、例"
2216+ "えば ``importlib.util.resolve_name('sys', __spec__.parent)`` を使うときに "
2217+ "**package** 変数が必要かどうかを確認する必要がなくなります。"
21772218
21782219#: ../../library/importlib.rst:1495
21792220msgid ""
0 commit comments