# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2020, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # Takeshi Mizumoto , 2017 # Arihiro TAKASE, 2017 # Nozomu Kaneko , 2017 # tomo, 2020 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-02-09 12:40+0000\n" "PO-Revision-Date: 2017-02-16 17:35+0000\n" "Last-Translator: tomo, 2020\n" "Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/import.rst:6 msgid "Importing Modules" msgstr "モジュールのインポート" #: ../../c-api/import.rst:16 msgid "" "This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below, " "leaving the *globals* and *locals* arguments set to ``NULL`` and *level* set" " to 0. When the *name* argument contains a dot (when it specifies a " "submodule of a package), the *fromlist* argument is set to the list " "``['*']`` so that the return value is the named module rather than the top-" "level package containing it as would otherwise be the case. (Unfortunately," " this has an additional side effect when *name* in fact specifies a " "subpackage instead of a submodule: the submodules specified in the package's" " ``__all__`` variable are loaded.) Return a new reference to the imported " "module, or ``NULL`` with an exception set on failure. A failing import of a" " module doesn't leave the module in :data:`sys.modules`." msgstr "" "この関数は下で述べる :c:func:`PyImport_ImportModuleEx` を単純化したインタフェースで、 *globals* および *locals* 引数を ``NULL`` のままにし、 *level* を 0 にしたものです。\n" "*name* 引数にドットが含まれる場合 (あるパッケージのサブモジュールを指定している場合)、 *fromlist* 引数がリスト ``['*']`` に追加され、戻り値がモジュールを含むトップレベルパッケージではなく名前つきモジュール (named module) になるようにします。\n" "(残念ながらこのやり方には、 *name* が実際にはサブモジュールでなくサブパッケージを指定している場合、パッケージの ``__all__`` 変数に指定されているサブモジュールがロードされてしまうという副作用があります。)\n" "インポートされたモジュールへの新たな参照を返します。\n" "失敗した場合には例外をセットし、 ``NULL`` を返します。インポートに失敗したモジュールは :data:`sys.modules` に残りません。" #: ../../c-api/import.rst:28 ../../c-api/import.rst:89 msgid "This function always uses absolute imports." msgstr "この関数は常に絶対インポートを使用します。" #: ../../c-api/import.rst:33 msgid "" "This function is a deprecated alias of :c:func:`PyImport_ImportModule`." msgstr "この関数は、 :c:func:`PyImport_ImportModule` の廃止予定のエイリアスです。" #: ../../c-api/import.rst:35 msgid "" "This function used to fail immediately when the import lock was held by " "another thread. In Python 3.3 though, the locking scheme switched to per-" "module locks for most purposes, so this function's special behaviour isn't " "needed anymore." msgstr "" "この関数は、従来は別のスレッドによってインポートロックが行われていた場合は即座に失敗していました。しかし Python 3.3 " "では、大部分の目的でロックスキームがモジュールごとのロックに移行したので、この関数の特別な振る舞いはもはや必要ではありません。" #: ../../c-api/import.rst:46 msgid "" "Import a module. This is best described by referring to the built-in Python" " function :func:`__import__`." msgstr "" "モジュールをインポートします。モジュールのインポートについては組み込みの Python 関数 :func:`__import__` " "を読むとよくわかります。" #: ../../c-api/import.rst:49 ../../c-api/import.rst:65 msgid "" "The return value is a new reference to the imported module or top-level " "package, or ``NULL`` with an exception set on failure. Like for " ":func:`__import__`, the return value when a submodule of a package was " "requested is normally the top-level package, unless a non-empty *fromlist* " "was given." msgstr "" "戻り値は、インポートされたモジュールかトップレベルパッケージへの新しい参照か、失敗した場合は例外を設定して ``NULL`` を返します。\n" ":func:`__import__` と同じように、パッケージのサブモジュールが要求されたときは、空でない *fromlist* を渡された時以外は、トップレベルのパッケージを返します。" #: ../../c-api/import.rst:55 msgid "" "Failing imports remove incomplete module objects, like with " ":c:func:`PyImport_ImportModule`." msgstr "" "インポートが失敗した場合は、:c:func:`PyImport_ImportModule` と同様に不完全なモジュールのオブジェクトを削除します。" #: ../../c-api/import.rst:61 msgid "" "Import a module. This is best described by referring to the built-in Python" " function :func:`__import__`, as the standard :func:`__import__` function " "calls this function directly." msgstr "" "モジュールをインポートします。モジュールのインポートについては組み込みの Python 関数 :func:`__import__` " "を読むとよく分かります。というのも、標準の :func:`__import__` はこの関数を直接呼び出しているからです。" #: ../../c-api/import.rst:75 msgid "" "Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a " "UTF-8 encoded string instead of a Unicode object." msgstr "" ":c:func:`PyImport_ImportModuleLevelObject` と似ていますが、name が Unicode オブジェクトではなく" " UTF-8 でエンコードされた文字列である点で異なります。" #: ../../c-api/import.rst:78 msgid "Negative values for *level* are no longer accepted." msgstr "*level* にはもはや負の値は使用できません。" #: ../../c-api/import.rst:83 msgid "" "This is a higher-level interface that calls the current \"import hook " "function\" (with an explicit *level* of 0, meaning absolute import). It " "invokes the :func:`__import__` function from the ``__builtins__`` of the " "current globals. This means that the import is done using whatever import " "hooks are installed in the current environment." msgstr "" "現在の \"インポートフック関数\" を呼び出すための高水準のインタフェースです (*level* に 0 を明示すると、絶対インポートを意味します)。" " この関数は現在のグローバル変数辞書内の ``__builtins__`` から :func:`__import__` " "関数を呼び出します。すなわち、現在の環境にインストールされているインポートフック使ってインポートを行います。" #: ../../c-api/import.rst:94 msgid "" "Reload a module. Return a new reference to the reloaded module, or ``NULL``" " with an exception set on failure (the module still exists in this case)." msgstr "" "モジュールを再ロード (reload) します。戻り値は再ロードしたモジュールかトップレベルパッケージへの新たな参照になります。\n" "失敗した場合には例外をセットし、``NULL`` を返します (その場合でも、モジュールは生成されている場合があります)。" #: ../../c-api/import.rst:100 msgid "" "Return the module object corresponding to a module name. The *name* " "argument may be of the form ``package.module``. First check the modules " "dictionary if there's one there, and if not, create a new one and insert it " "in the modules dictionary. Return ``NULL`` with an exception set on failure." msgstr "" "モジュール名に対応するモジュールオブジェクトを返します。*name* 引数は ``package.module`` の形式でもかまいません。\n" "まずモジュール辞書に該当するモジュールがあるかどうか調べ、なければ新たなモジュールを生成してモジュール辞書に挿入します。\n" "失敗した場合には例外をセットして ``NULL`` を返します。" #: ../../c-api/import.rst:107 msgid "" "This function does not load or import the module; if the module wasn't " "already loaded, you will get an empty module object. Use " ":c:func:`PyImport_ImportModule` or one of its variants to import a module. " "Package structures implied by a dotted name for *name* are not created if " "not already present." msgstr "" "この関数はモジュールのインポートやロードを行いません; モジュールがまだロードされていなければ、空のモジュールオブジェクトを得ることになります。 " ":c:func:`PyImport_ImportModule` やその別形式を使ってモジュールをインポートしてください。ドット名表記で指定した " "*name* が存在しない場合、パッケージ構造は作成されません。" #: ../../c-api/import.rst:117 msgid "" "Similar to :c:func:`PyImport_AddModuleObject`, but the name is a UTF-8 " "encoded string instead of a Unicode object." msgstr "" ":c:func:`PyImport_AddModuleObject` と似ていますが、name が UTF-8 でエンコードされた文字列ではなく " "Unicode オブジェクトを使用する点で異なります。" #: ../../c-api/import.rst:125 msgid "" "Given a module name (possibly of the form ``package.module``) and a code " "object read from a Python bytecode file or obtained from the built-in " "function :func:`compile`, load the module. Return a new reference to the " "module object, or ``NULL`` with an exception set if an error occurred. " "*name* is removed from :attr:`sys.modules` in error cases, even if *name* " "was already in :attr:`sys.modules` on entry to " ":c:func:`PyImport_ExecCodeModule`. Leaving incompletely initialized modules" " in :attr:`sys.modules` is dangerous, as imports of such modules have no way" " to know that the module object is an unknown (and probably damaged with " "respect to the module author's intents) state." msgstr "" "モジュール名 (``package.module`` 形式でも構いません) および Python のバイトコードファイルや組み込み関数 :func:`compile` で得られたコードオブジェクトを元にモジュールをロードします。\n" "モジュールオブジェクトへの新たな参照を返します。\n" "失敗した場合には例外をセットし、 ``NULL`` を返します。たとえ :c:func:`PyImport_ExecCodeModule` の処理に入った時に *name* が :attr:`sys.modules` に入っていたとしても、インポートに失敗したモジュールは :attr:`sys.modules` に残りません。\n" "初期化の不完全なモジュールを :attr:`sys.modules` に残すのは危険であり、そのようなモジュールをインポートするコードにとっては、モジュールの状態がわからない (モジュール作者の意図から外れた壊れた状態かもしれない) からです。" #: ../../c-api/import.rst:135 msgid "" "The module's :attr:`__spec__` and :attr:`__loader__` will be set, if not set" " already, with the appropriate values. The spec's loader will be set to the" " module's ``__loader__`` (if set) and to an instance of " ":class:`SourceFileLoader` otherwise." msgstr "" "モジュールの :attr:`__spec__` と :attr:`__loader__` がまだ設定されていなければ、適切な値が設定されます。spec " "の ローダーは、モジュールの ``__loader__`` が (もし設定されていれば) それに設定され、そうでなければ " ":class:`SourceFileLoader` のインスタンスに設定されます。" #: ../../c-api/import.rst:140 msgid "" "The module's :attr:`__file__` attribute will be set to the code object's " ":c:member:`co_filename`. If applicable, :attr:`__cached__` will also be " "set." msgstr "" "モジュールの :attr:`__file__` 属性はコードオブジェクトの :c:member:`co_filename` " "へ設定されます。もし適切な場合は、 :attr:`__cached__` へも設定されます。" #: ../../c-api/import.rst:144 msgid "" "This function will reload the module if it was already imported. See " ":c:func:`PyImport_ReloadModule` for the intended way to reload a module." msgstr "" "この関数は、すでにインポートされているモジュールの場合には再ロードを行います。意図的にモジュールの再ロードを行う方法は " ":c:func:`PyImport_ReloadModule` を参照してください。" #: ../../c-api/import.rst:147 msgid "" "If *name* points to a dotted name of the form ``package.module``, any " "package structures not already created will still not be created." msgstr "" "*name* が ``package.module`` " "形式のドット名表記であった場合、まだ作成されていないパッケージ構造はその作成されないままになります。" #: ../../c-api/import.rst:150 msgid "" "See also :c:func:`PyImport_ExecCodeModuleEx` and " ":c:func:`PyImport_ExecCodeModuleWithPathnames`." msgstr "" ":c:func:`PyImport_ExecCodeModuleEx` と " ":c:func:`PyImport_ExecCodeModuleWithPathnames` も参照してください。" #: ../../c-api/import.rst:156 msgid "" "Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute " "of the module object is set to *pathname* if it is non-``NULL``." msgstr "" ":c:func:`PyImport_ExecCodeModule` と似ていますが、*pathname* が ``NULL`` " "でない場合にモジュールオブジェクトの :attr:`__file__` 属性に *pathname* が設定される点が異なります。" #: ../../c-api/import.rst:159 msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`." msgstr ":c:func:`PyImport_ExecCodeModuleWithPathnames` も参照してください。" #: ../../c-api/import.rst:164 msgid "" "Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__` " "attribute of the module object is set to *cpathname* if it is non-``NULL``." " Of the three functions, this is the preferred one to use." msgstr "" ":c:func:`PyImport_ExecCodeModuleEx` と似ていますが、*cpathname* が ``NULL`` " "でない場合にモジュールオブジェクトの :attr:`__cached__` 属性に *cpathname* が設定される点が異なります。これらの 3 " "つの関数のうち、この関数の使用が望ましいです。" #: ../../c-api/import.rst:173 msgid "" "Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and " "*cpathname* are UTF-8 encoded strings. Attempts are also made to figure out " "what the value for *pathname* should be from *cpathname* if the former is " "set to ``NULL``." msgstr "" ":c:func:`PyImport_ExecCodeModuleObject` と似ていますが、 *name* と *pathname*、 " "*cpathname* が UTF-8 でエンコードされた文字列である点が異なります。もし *pathname* が ``NULL`` " "の場合、*cpathname* から、*pathname* どのような値になるべきかを知る試みもなされます。" #: ../../c-api/import.rst:179 msgid "" "Uses :func:`imp.source_from_cache()` in calculating the source path if only " "the bytecode path is provided." msgstr "" "バイトコードのパスが与えられた場合にのみ :func:`imp.source_from_cache()` がソースパスの計算に使用されます。" #: ../../c-api/import.rst:186 msgid "" "Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` " "file). The magic number should be present in the first four bytes of the " "bytecode file, in little-endian byte order. Returns ``-1`` on error." msgstr "" "Python バイトコードファイル (別名 :file:`.pyc` ファイル) " "のマジックナンバーを返します。マジックナンバーはバイトコードファイルの最初の4バイトに、リトルエンディアンバイトオーダーで現れるべきです。エラーの場合は" " ``-1`` を返します。" #: ../../c-api/import.rst:190 msgid "Return value of ``-1`` upon failure." msgstr "失敗した場合は ``-1`` の値を返します。" #: ../../c-api/import.rst:196 msgid "" "Return the magic tag string for :pep:`3147` format Python bytecode file " "names. Keep in mind that the value at ``sys.implementation.cache_tag`` is " "authoritative and should be used instead of this function." msgstr "" "マジックタグ文字列を Python バイトコードファイル名の :pep:`3147` " "フォーマットで返します。``sys.implementation.cache_tag`` " "の値が信頼でき、かつこの関数の代わりに使用すべきであることを肝に命じましょう。" #: ../../c-api/import.rst:204 msgid "" "Return the dictionary used for the module administration (a.k.a. " "``sys.modules``). Note that this is a per-interpreter variable." msgstr "" "モジュール管理のための辞書 (いわゆる ``sys.modules``)を返します。この辞書はインタプリタごとに一つだけある変数なので注意してください。" #: ../../c-api/import.rst:209 msgid "" "Return the already imported module with the given name. If the module has " "not been imported yet then returns ``NULL`` but does not set an error. " "Returns ``NULL`` and sets an error if the lookup failed." msgstr "" "与えられた名前の既にインポート済みのモジュールを返します。\n" "モジュールがインポートされていなかった場合は、 ``NULL`` を返しますが、エラーはセットしません。\n" "モジュールの検索に失敗した場合は、 ``NULL`` を返し、エラーをセットします。" #: ../../c-api/import.rst:217 msgid "" "Return a finder object for a :data:`sys.path`/:attr:`pkg.__path__` item " "*path*, possibly by fetching it from the :data:`sys.path_importer_cache` " "dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook" " is found that can handle the path item. Return ``None`` if no hook could; " "this tells our caller that the :term:`path based finder` could not find a " "finder for this path item. Cache the result in " ":data:`sys.path_importer_cache`. Return a new reference to the finder " "object." msgstr "" ":data:`sys.path` もしくは :attr:`pkg.__path__` の要素である *path* を見付けるためのオブジェクトを返します。場合によっては :data:`sys.path_importer_cache` 辞書から取得することもあります。\n" "もしまだオブジェクトがキャッシュされていなかった場合は、 path 要素を扱えるフックが見付かるまで :data:`sys.path_hooks` を走査します。\n" "どのフックも path 要素を扱えない場合は ``None`` を返します; これにより、 :term:`path based finder` がこの path 要素を見付けるためのオブジェクトが得られなかったことを呼び出し元に伝えます。\n" "最終的に得られたオブジェクトを :data:`sys.path_importer_cache` へキャッシュし、オブジェクトへの新たな参照を返します。" #: ../../c-api/import.rst:228 msgid "Initialize the import mechanism. For internal use only." msgstr "インポート機構を初期化します。内部使用だけのための関数です。" #: ../../c-api/import.rst:233 msgid "Empty the module table. For internal use only." msgstr "モジュールテーブルを空にします。内部使用だけのための関数です。" #: ../../c-api/import.rst:238 msgid "Finalize the import mechanism. For internal use only." msgstr "インポート機構を終了処理します。内部使用だけのための関数です。" #: ../../c-api/import.rst:243 msgid "" "Load a frozen module named *name*. Return ``1`` for success, ``0`` if the " "module is not found, and ``-1`` with an exception set if the initialization " "failed. To access the imported module on a successful load, use " ":c:func:`PyImport_ImportModule`. (Note the misnomer --- this function would" " reload the module if it was already imported.)" msgstr "" "*name* という名前のフリーズ (freeze) されたモジュールをロードします。成功すると ``1`` を、モジュールが見つからなかった場合には " "``0`` を、初期化が失敗した場合には例外をセットして ``-1`` を返します。ロードに成功したモジュールにアクセスするには " ":c:func:`PyImport_ImportModule` を使ってください。 (Note この関数はいささか誤解を招く名前です --- " "この関数はモジュールがすでにインポートされていたらリロードしてしまいます。)" #: ../../c-api/import.rst:251 msgid "The ``__file__`` attribute is no longer set on the module." msgstr "``__file__`` 属性はもうモジュールにセットされません。" #: ../../c-api/import.rst:257 msgid "" "Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a " "UTF-8 encoded string instead of a Unicode object." msgstr "" ":c:func:`PyImport_ImportFrozenModuleObject` と似ていますが、name は UTF-8 " "でエンコードされた文字列の代わりに、 Unicode オブジェクトを使用する点が異なります。" #: ../../c-api/import.rst:265 msgid "" "This is the structure type definition for frozen module descriptors, as " "generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the" " Python source distribution). Its definition, found in " ":file:`Include/import.h`, is::" msgstr "" ":program:`freeze` ユーティリティが生成するようなフリーズ化モジュールデスクリプタの構造体型定義です。 (Python ソース配布物の " ":file:`Tools/freeze/` を参照してください) この構造体の定義は :file:`Include/import.h` " "にあり、以下のようになっています::" #: ../../c-api/import.rst:279 msgid "" "This pointer is initialized to point to an array of :c:type:`struct _frozen`" " records, terminated by one whose members are all ``NULL`` or zero. When a " "frozen module is imported, it is searched in this table. Third-party code " "could play tricks with this to provide a dynamically created collection of " "frozen modules." msgstr "" "このポインタは :c:type:`struct _frozen` のレコードからなり、終端の要素のメンバが ``NULL`` かゼロになっているような配列を指すよう初期化されます。\n" "フリーズされたモジュールをインポートするとき、このテーブルを検索します。\n" "サードパーティ製のコードからこのポインタに仕掛けを講じて、動的に生成されたフリーズ化モジュールの集合を提供するようにできます。" #: ../../c-api/import.rst:287 msgid "" "Add a single module to the existing table of built-in modules. This is a " "convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning " "``-1`` if the table could not be extended. The new module can be imported " "by the name *name*, and uses the function *initfunc* as the initialization " "function called on the first attempted import. This should be called before" " :c:func:`Py_Initialize`." msgstr "" "既存の組み込みモジュールテーブルに単一のモジュールを追加します。この関数は利便性を目的とした " ":c:func:`PyImport_ExtendInittab` のラッパ関数で、テーブルが拡張できないときには ``-1`` " "を返します。新たなモジュールは *name* でインポートでき、最初にインポートを試みた際に呼び出される関数として *initfunc* を使います。 " ":c:func:`Py_Initialize` よりも前に呼び出さなければなりません。" #: ../../c-api/import.rst:297 msgid "" "Structure describing a single entry in the list of built-in modules. Each " "of these structures gives the name and initialization function for a module " "built into the interpreter. The name is an ASCII encoded string. Programs " "which embed Python may use an array of these structures in conjunction with " ":c:func:`PyImport_ExtendInittab` to provide additional built-in modules. The" " structure is defined in :file:`Include/import.h` as::" msgstr "" "組み込みモジュールリスト内の一つのエントリを記述している構造体です。リスト内の各構造体には、インタプリタ内に組み込まれているモジュールの名前と初期化関数が指定されています。" " Python を埋め込むようなプログラムは、この構造体の配列と :c:func:`PyImport_ExtendInittab` " "を組み合わせて、追加の組み込みモジュールを提供できます。構造体は :file:`Include/import.h` で以下のように定義されています::" #: ../../c-api/import.rst:312 msgid "" "Add a collection of modules to the table of built-in modules. The *newtab* " "array must end with a sentinel entry which contains ``NULL`` for the " ":attr:`name` field; failure to provide the sentinel value can result in a " "memory fault. Returns ``0`` on success or ``-1`` if insufficient memory " "could be allocated to extend the internal table. In the event of failure, " "no modules are added to the internal table. This should be called before " ":c:func:`Py_Initialize`." msgstr "" "組み込みモジュールのテーブルに一群のモジュールを追加します。\n" "配列 *newtab* は :attr:`name` フィールドが ``NULL`` になっているセンチネル (sentinel) エントリで終端されていなければなりません。センチネル値を与えられなかった場合にはメモリ違反になるかもしれません。\n" "成功すると ``0`` を、内部テーブルを拡張するのに十分なメモリを確保できなかった場合には ``-1`` を返します。\n" "操作が失敗した場合、モジュールは一切内部テーブルに追加されません。\n" ":c:func:`Py_Initialize` よりも前に呼び出さなければなりません。"