# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # Shin Saito, 2021 # tomo, 2021 # Yusuke Miyazaki , 2021 # mollinaca, 2021 # Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-07-26 13:07+0000\n" "PO-Revision-Date: 2021-06-28 00:47+0000\n" "Last-Translator: Osamu NAKAMURA, 2021\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" #: ../../glossary.rst:5 msgid "Glossary" msgstr "用語集" #: ../../glossary.rst:10 msgid "``>>>``" msgstr "``>>>``" #: ../../glossary.rst:12 msgid "" "The default Python prompt of the interactive shell. Often seen for code " "examples which can be executed interactively in the interpreter." msgstr "" "インタラクティブシェルにおけるデフォルトの Python プロンプトです。インタプリタでインタラクティブに実行されるコード例でよく出てきます。" #: ../../glossary.rst:14 msgid "``...``" msgstr "``...``" #: ../../glossary.rst:16 msgid "Can refer to:" msgstr "次のものが考えられます:" #: ../../glossary.rst:18 msgid "" "The default Python prompt of the interactive shell when entering the code " "for an indented code block, when within a pair of matching left and right " "delimiters (parentheses, square brackets, curly braces or triple quotes), or" " after specifying a decorator." msgstr "" "インタラクティブシェルにおいて、インデントされたコードブロック、対応する左右の区切り文字の組 (丸括弧、角括弧、波括弧、三重引用符) " "の内側、デコレーターの後に、コードを入力する際に表示されるデフォルトの Python プロンプトです。" #: ../../glossary.rst:23 msgid "The :const:`Ellipsis` built-in constant." msgstr "組み込みの定数 :const:`Ellipsis` 。" #: ../../glossary.rst:24 msgid "2to3" msgstr "2to3" #: ../../glossary.rst:26 msgid "" "A tool that tries to convert Python 2.x code to Python 3.x code by handling " "most of the incompatibilities which can be detected by parsing the source " "and traversing the parse tree." msgstr "" "Python 2.x のコードを Python 3.x のコードに変換するツールです。ソースコードを解析してその解析木を巡回 (traverse) " "することで検知できる、非互換性の大部分を処理します。" #: ../../glossary.rst:30 msgid "" "2to3 is available in the standard library as :mod:`lib2to3`; a standalone " "entry point is provided as :file:`Tools/scripts/2to3`. See " ":ref:`2to3-reference`." msgstr "" "2to3 は標準ライブラリの :mod:`lib2to3` として利用できます。単体のツールとして使えるスクリプトが " ":file:`Tools/scripts/2to3` として提供されています。 :ref:`2to3-reference` を参照してください。" #: ../../glossary.rst:33 msgid "abstract base class" msgstr "abstract base class" #: ../../glossary.rst:35 msgid "" "Abstract base classes complement :term:`duck-typing` by providing a way to " "define interfaces when other techniques like :func:`hasattr` would be clumsy" " or subtly wrong (for example with :ref:`magic methods `). " "ABCs introduce virtual subclasses, which are classes that don't inherit from" " a class but are still recognized by :func:`isinstance` and " ":func:`issubclass`; see the :mod:`abc` module documentation. Python comes " "with many built-in ABCs for data structures (in the :mod:`collections.abc` " "module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` " "module), import finders and loaders (in the :mod:`importlib.abc` module). " "You can create your own ABCs with the :mod:`abc` module." msgstr "" "(抽象基底クラス) 抽象基底クラスは :term:`duck-typing` を補完するもので、 :func:`hasattr` " "などの別のテクニックでは不恰好であったり微妙に誤る (例えば :ref:`magic methods ` の場合) " "場合にインターフェースを定義する方法を提供します。ABC は仮想 (virtual) サブクラスを導入します。これは親クラスから継承しませんが、それでも" " :func:`isinstance` や :func:`issubclass` に認識されます; :mod:`abc` " "モジュールのドキュメントを参照してください。Python には、多くの組み込み ABC " "が同梱されています。その対象は、(:mod:`collections.abc` モジュールで) データ構造、(:mod:`numbers` " "モジュールで) 数、(:mod:`io` モジュールで) ストリーム、(:mod:`importlib.abc` モジュールで) " "インポートファインダ及びローダーです。 :mod:`abc` モジュールを利用して独自の ABC を作成できます。" #: ../../glossary.rst:46 msgid "annotation" msgstr "annotation" #: ../../glossary.rst:48 msgid "" "A label associated with a variable, a class attribute or a function " "parameter or return value, used by convention as a :term:`type hint`." msgstr "" "(アノテーション) 変数、クラス属性、関数のパラメータや返り値に関係するラベルです。\n" "慣例により :term:`type hint` として使われています。" #: ../../glossary.rst:52 msgid "" "Annotations of local variables cannot be accessed at runtime, but " "annotations of global variables, class attributes, and functions are stored " "in the :attr:`__annotations__` special attribute of modules, classes, and " "functions, respectively." msgstr "" "ローカル変数のアノテーションは実行時にはアクセスできませんが、グローバル変数、クラス属性、関数のアノテーションはそれぞれモジュール、クラス、関数の " ":attr:`__annotations__` 特殊属性に保持されています。" #: ../../glossary.rst:58 msgid "" "See :term:`variable annotation`, :term:`function annotation`, :pep:`484` and" " :pep:`526`, which describe this functionality. Also see :ref:`annotations-" "howto` for best practices on working with annotations." msgstr "" #: ../../glossary.rst:62 msgid "argument" msgstr "引数 (argument)" #: ../../glossary.rst:64 msgid "" "A value passed to a :term:`function` (or :term:`method`) when calling the " "function. There are two kinds of argument:" msgstr "" "(実引数) 関数を呼び出す際に、 :term:`関数` (または :term:`メソッド `) " "に渡す値です。実引数には2種類あります:" #: ../../glossary.rst:67 msgid "" ":dfn:`keyword argument`: an argument preceded by an identifier (e.g. " "``name=``) in a function call or passed as a value in a dictionary preceded " "by ``**``. For example, ``3`` and ``5`` are both keyword arguments in the " "following calls to :func:`complex`::" msgstr "" ":dfn:`キーワード引数`: 関数呼び出しの際に引数の前に識別子がついたもの (例: ``name=``) や、 ``**`` " "に続けた辞書の中の値として渡された引数。例えば、次の :func:`complex` の呼び出しでは、 ``3`` と ``5`` " "がキーワード引数です::" #: ../../glossary.rst:75 msgid "" ":dfn:`positional argument`: an argument that is not a keyword argument. " "Positional arguments can appear at the beginning of an argument list and/or " "be passed as elements of an :term:`iterable` preceded by ``*``. For example," " ``3`` and ``5`` are both positional arguments in the following calls::" msgstr "" ":dfn:`位置引数`: キーワード引数以外の引数。位置引数は引数リストの先頭に書くことができ、また ``*`` に続けた " ":term:`iterable` の要素として渡すことができます。例えば、次の例では ``3`` と ``5`` は両方共位置引数です::" #: ../../glossary.rst:84 msgid "" "Arguments are assigned to the named local variables in a function body. See " "the :ref:`calls` section for the rules governing this assignment. " "Syntactically, any expression can be used to represent an argument; the " "evaluated value is assigned to the local variable." msgstr "" "実引数は関数の実体において名前付きのローカル変数に割り当てられます。割り当てを行う規則については :ref:`calls` " "を参照してください。シンタックスにおいて実引数を表すためにあらゆる式を使うことが出来ます。評価された値はローカル変数に割り当てられます。" #: ../../glossary.rst:89 msgid "" "See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the" " difference between arguments and parameters `, " "and :pep:`362`." msgstr "" ":term:`仮引数` 、FAQ の :ref:`実引数と仮引数の違いは何ですか? ` 、:pep:`362` を参照してください。" #: ../../glossary.rst:92 msgid "asynchronous context manager" msgstr "asynchronous context manager" #: ../../glossary.rst:94 msgid "" "An object which controls the environment seen in an :keyword:`async with` " "statement by defining :meth:`__aenter__` and :meth:`__aexit__` methods. " "Introduced by :pep:`492`." msgstr "" "(非同期コンテキストマネージャ)\n" ":meth:`__aenter__` と :meth:`__aexit__` メソッドを定義することで :keyword:`async with` 文内の環境を管理するオブジェクトです。\n" ":pep:`492` で導入されました。" #: ../../glossary.rst:97 msgid "asynchronous generator" msgstr "asynchronous generator" #: ../../glossary.rst:99 msgid "" "A function which returns an :term:`asynchronous generator iterator`. It " "looks like a coroutine function defined with :keyword:`async def` except " "that it contains :keyword:`yield` expressions for producing a series of " "values usable in an :keyword:`async for` loop." msgstr "" "(非同期ジェネレータ)\n" ":term:`asynchronous generator iterator` を返す関数です。\n" ":keyword:`async def` で定義されたコルーチン関数に似ていますが、 :keyword:`yield` 式を持つ点で異なります。\n" ":keyword:`yield` 式は :keyword:`async for` ループで使用できる値の並びを生成するのに使用されます。" #: ../../glossary.rst:104 msgid "" "Usually refers to an asynchronous generator function, but may refer to an " "*asynchronous generator iterator* in some contexts. In cases where the " "intended meaning isn't clear, using the full terms avoids ambiguity." msgstr "" "通常は非同期ジェネレータ関数を指しますが、文脈によっては *非同期ジェネレータイテレータ* を指す場合があります。\n" "意図された意味が明らかでない場合、 明瞭化のために完全な単語を使用します。" #: ../../glossary.rst:108 msgid "" "An asynchronous generator function may contain :keyword:`await` expressions " "as well as :keyword:`async for`, and :keyword:`async with` statements." msgstr "" "非同期ジェネレータ関数には、 :keyword:`async for` 文や :keyword:`async with` 文だけでなく " ":keyword:`await` 式もあることがあります。" #: ../../glossary.rst:111 msgid "asynchronous generator iterator" msgstr "asynchronous generator iterator" #: ../../glossary.rst:113 msgid "An object created by a :term:`asynchronous generator` function." msgstr "" "(非同期ジェネレータイテレータ)\n" ":term:`asynchronous generator` 関数で生成されるオブジェクトです。" #: ../../glossary.rst:115 msgid "" "This is an :term:`asynchronous iterator` which when called using the " ":meth:`__anext__` method returns an awaitable object which will execute the " "body of the asynchronous generator function until the next :keyword:`yield` " "expression." msgstr "" "これは、 :meth:`__anext__` メソッドを使って呼び出されたときに awaitable オブジェクトを返す :term:`asynchronous iterator` です。\n" "この awaitable オブジェクトは、次の :keyword:`yield` 式までの非同期ジェネレータ関数の本体を実行します。" #: ../../glossary.rst:120 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" "statements). When the *asynchronous generator iterator* effectively resumes" " with another awaitable returned by :meth:`__anext__`, it picks up where it " "left off. See :pep:`492` and :pep:`525`." msgstr "" ":keyword:`yield` にくるたびに、その位置での実行状態 (ローカル変数と保留状態の try 文) 処理は一時停止されます。\n" ":meth:`__anext__` で返された他の awaitable によって *非同期ジェネレータイテレータ* が実際に再開されたとき、中断した箇所を取得します。\n" ":pep:`492` および :pep:`525` を参照してください。" #: ../../glossary.rst:125 msgid "asynchronous iterable" msgstr "asynchronous iterable" #: ../../glossary.rst:127 msgid "" "An object, that can be used in an :keyword:`async for` statement. Must " "return an :term:`asynchronous iterator` from its :meth:`__aiter__` method. " "Introduced by :pep:`492`." msgstr "" "(非同期イテラブル)\n" ":keyword:`async for` 文の中で使用できるオブジェクトです。\n" "自身の :meth:`__aiter__` メソッドから :term:`asynchronous iterator` を返さなければなりません。 \n" ":pep:`492` で導入されました。" #: ../../glossary.rst:130 msgid "asynchronous iterator" msgstr "asynchronous iterator" #: ../../glossary.rst:132 msgid "" "An object that implements the :meth:`__aiter__` and :meth:`__anext__` " "methods. ``__anext__`` must return an :term:`awaitable` object. " ":keyword:`async for` resolves the awaitables returned by an asynchronous " "iterator's :meth:`__anext__` method until it raises a " ":exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." msgstr "" "(非同期イテレータ)\n" ":meth:`__aiter__` と :meth:`__anext__` メソッドを実装したオブジェクトです。\n" "``__anext__`` は :term:`awaitable` オブジェクトを返さなければなりません。\n" ":keyword:`async for` は :exc:`StopAsyncIteration` 例外を送出するまで、非同期イテレータの :meth:`__anext__` メソッドが返す awaitable を解決します。\n" ":pep:`492` で導入されました。" #: ../../glossary.rst:137 msgid "attribute" msgstr "属性" #: ../../glossary.rst:139 msgid "" "A value associated with an object which is referenced by name using dotted " "expressions. For example, if an object *o* has an attribute *a* it would be" " referenced as *o.a*." msgstr "" "(属性) オブジェクトに関連付けられ、ドット表記式によって名前で参照される値です。例えば、オブジェクト *o* が属性 *a* " "を持っているとき、その属性は *o.a* で参照されます。" #: ../../glossary.rst:142 msgid "awaitable" msgstr "awaitable" #: ../../glossary.rst:144 msgid "" "An object that can be used in an :keyword:`await` expression. Can be a " ":term:`coroutine` or an object with an :meth:`__await__` method. See also " ":pep:`492`." msgstr "" "(待機可能) :keyword:`await` 式で使用することが出来るオブジェクトです。\n" ":term:`coroutine` か、 :meth:`__await__` メソッドがあるオブジェクトです。\n" ":pep:`492` を参照してください。" #: ../../glossary.rst:147 msgid "BDFL" msgstr "BDFL" #: ../../glossary.rst:149 msgid "" "Benevolent Dictator For Life, a.k.a. `Guido van Rossum " "`_, Python's creator." msgstr "" "慈悲深き終身独裁者 (Benevolent Dictator For Life) の略です。Python の作者、`Guido van Rossum " "`_ のことです。" #: ../../glossary.rst:151 msgid "binary file" msgstr "binary file" #: ../../glossary.rst:153 msgid "" "A :term:`file object` able to read and write :term:`bytes-like objects " "`. Examples of binary files are files opened in binary " "mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer`, " ":data:`sys.stdout.buffer`, and instances of :class:`io.BytesIO` and " ":class:`gzip.GzipFile`." msgstr "" "(バイナリファイル)\n" ":term:`bytes-like オブジェクト ` の読み込みおよび書き込みができる :term:`ファイルオブジェクト ` です。\n" "バイナリファイルの例は、バイナリモード (``'rb'``, ``'wb'`` or ``'rb+'``) で開かれたファイル、 :data:`sys.stdin.buffer` 、 :data:`sys.stdout.buffer` 、 :class:`io.BytesIO` や :class:`gzip.GzipFile`. のインスタンスです。" #: ../../glossary.rst:160 msgid "" "See also :term:`text file` for a file object able to read and write " ":class:`str` objects." msgstr "" ":class:`str` オブジェクトの読み書きができるファイルオブジェクトについては、 :term:`text file` も参照してください。" #: ../../glossary.rst:162 msgid "borrowed reference" msgstr "" #: ../../glossary.rst:164 msgid "" "In Python's C API, a borrowed reference is a reference to an object. It does" " not modify the object reference count. It becomes a dangling pointer if the" " object is destroyed. For example, a garbage collection can remove the last " ":term:`strong reference` to the object and so destroy it." msgstr "" #: ../../glossary.rst:169 msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended" " to convert it to a :term:`strong reference` in-place, except when the " "object cannot be destroyed before the last usage of the borrowed reference. " "The :c:func:`Py_NewRef` function can be used to create a new :term:`strong " "reference`." msgstr "" #: ../../glossary.rst:174 msgid "bytes-like object" msgstr "bytes-like object" #: ../../glossary.rst:176 msgid "" "An object that supports the :ref:`bufferobjects` and can export a " "C-:term:`contiguous` buffer. This includes all :class:`bytes`, " ":class:`bytearray`, and :class:`array.array` objects, as well as many common" " :class:`memoryview` objects. Bytes-like objects can be used for various " "operations that work with binary data; these include compression, saving to " "a binary file, and sending over a socket." msgstr "" ":ref:`bufferobjects` をサポートしていて、 C 言語の意味で :term:`連続した contiguous` バッファーを提供可能なオブジェクト。\n" ":class:`bytes`, :class:`bytearray`, :class:`array.array` や、多くの一般的な :class:`memoryview` オブジェクトがこれに当たります。\n" "bytes-like オブジェクトは、データ圧縮、バイナリファイルへの保存、ソケットを経由した送信など、バイナリデータを要求するいろいろな操作に利用することができます。" #: ../../glossary.rst:183 msgid "" "Some operations need the binary data to be mutable. The documentation often" " refers to these as \"read-write bytes-like objects\". Example mutable " "buffer objects include :class:`bytearray` and a :class:`memoryview` of a " ":class:`bytearray`. Other operations require the binary data to be stored in" " immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" "幾つかの操作ではバイナリデータを変更する必要があります。\n" "その操作のドキュメントではよく \"読み書き可能な bytes-like オブジェクト\" に言及しています。\n" "変更可能なバッファーオブジェクトには、 :class:`bytearray` と :class:`bytearray` の :class:`memoryview` などが含まれます。\n" "また、他の幾つかの操作では不変なオブジェクト内のバイナリデータ (\"読み出し専用の bytes-like オブジェクト\") を必要します。それには :class:`bytes` と :class:`bytes` の :class:`memoryview` オブジェクトが含まれます。" #: ../../glossary.rst:191 msgid "bytecode" msgstr "bytecode" #: ../../glossary.rst:193 msgid "" "Python source code is compiled into bytecode, the internal representation of" " a Python program in the CPython interpreter. The bytecode is also cached " "in ``.pyc`` files so that executing the same file is faster the second time " "(recompilation from source to bytecode can be avoided). This \"intermediate" " language\" is said to run on a :term:`virtual machine` that executes the " "machine code corresponding to each bytecode. Do note that bytecodes are not " "expected to work between different Python virtual machines, nor to be stable" " between Python releases." msgstr "" "(バイトコード) Python のソースコードは、 Python プログラムの CPython インタプリタの内部表現であるバイトコードへとコンパイルされます。\n" "バイトコードは ``.pyc`` ファイルにキャッシュされ、同じファイルが二度目に実行されるときはより高速になります (ソースコードからバイトコードへの再度のコンパイルは回避されます)。\n" "この \"中間言語 (intermediate language)\" は、各々のバイトコードに対応する機械語を実行する :term:`仮想マシン ` で動作するといえます。\n" "重要な注意として、バイトコードは異なる Python 仮想マシン間で動作することや、Python リリース間で安定であることは期待されていません。" #: ../../glossary.rst:203 msgid "" "A list of bytecode instructions can be found in the documentation for " ":ref:`the dis module `." msgstr "バイトコードの命令一覧は :ref:`dis モジュール ` にあります。" #: ../../glossary.rst:205 msgid "callback" msgstr "callback" #: ../../glossary.rst:207 msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." msgstr "(コールバック) 将来のある時点で実行されるために引数として渡される関数" #: ../../glossary.rst:209 msgid "class" msgstr "クラス" #: ../../glossary.rst:211 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." msgstr "" "(クラス) ユーザー定義オブジェクトを作成するためのテンプレートです。クラス定義は普通、そのクラスのインスタンス上の操作をするメソッドの定義を含みます。" #: ../../glossary.rst:214 msgid "class variable" msgstr "class variable" #: ../../glossary.rst:216 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." msgstr "(クラス変数) クラス上に定義され、クラスレベルで (つまり、クラスのインスタンス上ではなしに) 変更されることを目的としている変数です。" #: ../../glossary.rst:218 msgid "coercion" msgstr "coercion" #: ../../glossary.rst:220 msgid "" "The implicit conversion of an instance of one type to another during an " "operation which involves two arguments of the same type. For example, " "``int(3.15)`` converts the floating point number to the integer ``3``, but " "in ``3+4.5``, each argument is of a different type (one int, one float), and" " both must be converted to the same type before they can be added or it will" " raise a :exc:`TypeError`. Without coercion, all arguments of even " "compatible types would have to be normalized to the same value by the " "programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``." msgstr "" "(型強制) 同じ型の 2 引数を伴う演算の最中に行われる、ある型のインスタンスの別の型への暗黙の変換です。\n" "例えば、 ``int(3.15)`` は浮動小数点数を整数 ``3`` に変換します。しかし ``3+4.5`` では、各引数は型が異なり(一つは整数、一つは浮動小数点数)、加算をする前に同じ型に変換できなければ :exc:`TypeError` 例外が投げられます。\n" "型強制がなかったら、すべての引数は、たとえ互換な型であっても、単に ``3+4.5`` ではなく ``float(3)+4.5`` というように、プログラマーが同じ型に正規化しなければいけません。" #: ../../glossary.rst:228 msgid "complex number" msgstr "complex number" #: ../../glossary.rst:230 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " "are real multiples of the imaginary unit (the square root of ``-1``), often " "written ``i`` in mathematics or ``j`` in engineering. Python has built-in " "support for complex numbers, which are written with this latter notation; " "the imaginary part is written with a ``j`` suffix, e.g., ``3+1j``. To get " "access to complex equivalents of the :mod:`math` module, use :mod:`cmath`. " "Use of complex numbers is a fairly advanced mathematical feature. If you're" " not aware of a need for them, it's almost certain you can safely ignore " "them." msgstr "" "(複素数) よく知られている実数系を拡張したもので、すべての数は実部と虚部の和として表されます。虚数は虚数単位 (``-1`` の平方根) " "に実数を掛けたもので、一般に数学では ``i`` と書かれ、工学では ``j`` と書かれます。Python " "は複素数に組み込みで対応し、後者の表記を取っています。虚部は末尾に ``j`` をつけて書きます。例えば ``3+1j`` です。 " ":mod:`math` モジュールの複素数版を利用するには、 :mod:`cmath` " "を使います。複素数の使用はかなり高度な数学の機能です。必要性を感じなければ、ほぼ間違いなく無視してしまってよいでしょう。" #: ../../glossary.rst:240 msgid "context manager" msgstr "context manager" #: ../../glossary.rst:242 msgid "" "An object which controls the environment seen in a :keyword:`with` statement" " by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." msgstr "" "(コンテキストマネージャ)\n" ":meth:`__enter__` と :meth:`__exit__` メソッドを定義することで :keyword:`with` 文内の環境を管理するオブジェクトです。:pep:`343` を参照してください。" #: ../../glossary.rst:245 msgid "context variable" msgstr "context variable" #: ../../glossary.rst:247 msgid "" "A variable which can have different values depending on its context. This is" " similar to Thread-Local Storage in which each execution thread may have a " "different value for a variable. However, with context variables, there may " "be several contexts in one execution thread and the main usage for context " "variables is to keep track of variables in concurrent asynchronous tasks. " "See :mod:`contextvars`." msgstr "" "(コンテキスト変数) コンテキストに依存して異なる値を持つ変数。\n" "これは、ある変数の値が各々の実行スレッドで異なり得るスレッドローカルストレージに似ています。\n" "しかしコンテキスト変数では、 1 つの実行スレッドにいくつかのコンテキストがあり得、コンテキスト変数の主な用途は並列な非同期タスクの変数の追跡です。\n" ":mod:`contextvars` を参照してください。" #: ../../glossary.rst:254 msgid "contiguous" msgstr "contiguous" #: ../../glossary.rst:258 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " "contiguous. In one-dimensional arrays, the items must be laid out in memory" " next to each other, in order of increasing indexes starting from zero. In " "multidimensional C-contiguous arrays, the last index varies the fastest when" " visiting items in order of memory address. However, in Fortran contiguous " "arrays, the first index varies the fastest." msgstr "" "(隣接、連続) バッファが厳密に *C-連続* または *Fortran 連続* である場合に、そのバッファは連続しているとみなせます。\n" "ゼロ次元バッファは C 連続であり Fortran 連続です。\n" "一次元の配列では、その要素は必ずメモリ上で隣接するように配置され、添字がゼロから始まり増えていく順序で並びます。\n" "多次元の C-連続な配列では、メモリアドレス順に要素を巡る際には最後の添え字が最初に変わるのに対し、 Fortran 連続な配列では最初の添え字が最初に動きます。" #: ../../glossary.rst:266 msgid "coroutine" msgstr "コルーチン" #: ../../glossary.rst:268 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " "entered, exited, and resumed at many different points. They can be " "implemented with the :keyword:`async def` statement. See also :pep:`492`." msgstr "" "(コルーチン) コルーチンはサブルーチンのより一般的な形式です。\n" "サブルーチンには決められた地点から入り、別の決められた地点から出ます。\n" "コルーチンには多くの様々な地点から入る、出る、再開することができます。\n" "コルーチンは :keyword:`async def` 文で実装できます。\n" ":pep:`492` を参照してください。" #: ../../glossary.rst:273 msgid "coroutine function" msgstr "coroutine function" #: ../../glossary.rst:275 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain " ":keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords." " These were introduced by :pep:`492`." msgstr "" "(コルーチン関数)\n" ":term:`coroutine` オブジェクトを返す関数です。\n" "コルーチン関数は :keyword:`async def` 文で実装され、:keyword:`await`、:keyword:`async for`、 および :keyword:`async with` キーワードを持つことが出来ます。\n" "これらは :pep:`492` で導入されました。" #: ../../glossary.rst:280 msgid "CPython" msgstr "CPython" #: ../../glossary.rst:282 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\"" " is used when necessary to distinguish this implementation from others such " "as Jython or IronPython." msgstr "" "`python.org `_ で配布されている、Python " "プログラミング言語の標準的な実装です。\"CPython\" という単語は、この実装を Jython や IronPython " "といった他の実装と区別する必要が有る場合に利用されます。" #: ../../glossary.rst:286 msgid "decorator" msgstr "decorator" #: ../../glossary.rst:288 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " "decorators are :func:`classmethod` and :func:`staticmethod`." msgstr "" "(デコレータ) 別の関数を返す関数で、通常、 ``@wrapper`` 構文で関数変換として適用されます。デコレータの一般的な利用例は、 " ":func:`classmethod` と :func:`staticmethod` です。" #: ../../glossary.rst:292 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" msgstr "デコレータの文法はシンタックスシュガーです。次の2つの関数定義は意味的に同じものです::" #: ../../glossary.rst:303 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class" " definitions ` for more about decorators." msgstr "" "同じ概念がクラスにも存在しますが、あまり使われません。デコレータについて詳しくは、 :ref:`関数定義 ` および " ":ref:`クラス定義 ` のドキュメントを参照してください。" #: ../../glossary.rst:306 msgid "descriptor" msgstr "descriptor" #: ../../glossary.rst:308 msgid "" "Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or " ":meth:`__delete__`. When a class attribute is a descriptor, its special " "binding behavior is triggered upon attribute lookup. Normally, using *a.b* " "to get, set or delete an attribute looks up the object named *b* in the " "class dictionary for *a*, but if *b* is a descriptor, the respective " "descriptor method gets called. Understanding descriptors is a key to a deep" " understanding of Python because they are the basis for many features " "including functions, methods, properties, class methods, static methods, and" " reference to super classes." msgstr "" "(デスクリプタ) メソッド :meth:`__get__`, :meth:`__set__`, あるいは :meth:`__delete__` " "を定義しているオブジェクトです。あるクラス属性がデスクリプタであるとき、属性探索によって、束縛されている特別な動作が呼び出されます。通常、get,set,deleteのために" " *a.b* と書くと、 *a* のクラス辞書内でオブジェクト *b* を検索しますが、 *b* " "がデスクリプタであればそれぞれのデスクリプタメソッドが呼び出されます。デスクリプタの理解は、 Python " "を深く理解する上で鍵となります。というのは、デスクリプタこそが、関数、メソッド、プロパティ、クラスメソッド、静的メソッド、そしてスーパクラスの参照といった多くの機能の基盤だからです。" #: ../../glossary.rst:318 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." msgstr "" "デスクリプタのメソッドに関しての詳細は、 :ref:`descriptors` や :ref:`Descriptor How To Guide " "` を参照してください。" #: ../../glossary.rst:320 msgid "dictionary" msgstr "dictionary" #: ../../glossary.rst:322 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a" " hash in Perl." msgstr "" "(辞書) 任意のキーを値に対応付ける連想配列です。 :meth:`__hash__` メソッドと :meth:`__eq__` " "メソッドを実装した任意のオブジェクトをキーにできます。 Perl ではハッシュ (hash) と呼ばれています。" #: ../../glossary.rst:325 msgid "dictionary comprehension" msgstr "dictionary comprehension" #: ../../glossary.rst:327 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " "range(10)}`` generates a dictionary containing key ``n`` mapped to value ``n" " ** 2``. See :ref:`comprehensions`." msgstr "" "(辞書内包表記) iterable 内の全てあるいは一部の要素を処理して、その結果からなる辞書を返すコンパクトな書き方です。 ``results = " "{n: n ** 2 for n in range(10)}`` とすると、キー ``n`` を値 ``n ** 2`` に対応付ける辞書を生成します。" " :ref:`comprehensions` を参照してください。" #: ../../glossary.rst:331 msgid "dictionary view" msgstr "dictionary view" #: ../../glossary.rst:333 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and " ":meth:`dict.items` are called dictionary views. They provide a dynamic view " "on the dictionary’s entries, which means that when the dictionary changes, " "the view reflects these changes. To force the dictionary view to become a " "full list use ``list(dictview)``. See :ref:`dict-views`." msgstr "" "(辞書ビュー)\n" ":meth:`dict.keys`、:meth:`dict.values`、:meth:`dict.items` が返すオブジェクトです。\n" "辞書の項目の動的なビューを提供します。\n" "すなわち、辞書が変更されるとビューはそれを反映します。\n" "辞書ビューを強制的に完全なリストにするには ``list(dictview)`` を使用してください。 \n" ":ref:`dict-views` を参照してください。" #: ../../glossary.rst:339 msgid "docstring" msgstr "docstring" #: ../../glossary.rst:341 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " "the compiler and put into the :attr:`__doc__` attribute of the enclosing " "class, function or module. Since it is available via introspection, it is " "the canonical place for documentation of the object." msgstr "" "クラス、関数、モジュールの最初の式である文字列リテラルです。そのスイートの実行時には無視されますが、コンパイラによって識別され、そのクラス、関数、モジュールの" " :attr:`__doc__` 属性として保存されます。イントロスペクションできる(訳注: " "属性として参照できる)ので、オブジェクトのドキュメントを書く標準的な場所です。" #: ../../glossary.rst:347 msgid "duck-typing" msgstr "duck-typing" #: ../../glossary.rst:349 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " "called or used (\"If it looks like a duck and quacks like a duck, it must be" " a duck.\") By emphasizing interfaces rather than specific types, well-" "designed code improves its flexibility by allowing polymorphic substitution." " Duck-typing avoids tests using :func:`type` or :func:`isinstance`. (Note," " however, that duck-typing can be complemented with :term:`abstract base " "classes `.) Instead, it typically employs " ":func:`hasattr` tests or :term:`EAFP` programming." msgstr "" "あるオブジェクトが正しいインターフェースを持っているかを決定するのにオブジェクトの型を見ないプログラミングスタイルです。代わりに、単純にオブジェクトのメソッドや属性が呼ばれたり使われたりします。(「アヒルのように見えて、アヒルのように鳴けば、それはアヒルである。」)インターフェースを型より重視することで、上手くデザインされたコードは、ポリモーフィックな代替を許して柔軟性を向上させます。ダックタイピングは" " :func:`type` や :func:`isinstance` による判定を避けます。 (ただし、ダックタイピングを :term:`抽象基底クラス" " ` で補完することもできます。) その代わり、典型的に :func:`hasattr` 判定や " ":term:`EAFP` プログラミングを利用します。" #: ../../glossary.rst:358 msgid "EAFP" msgstr "EAFP" #: ../../glossary.rst:360 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " "exceptions if the assumption proves false. This clean and fast style is " "characterized by the presence of many :keyword:`try` and :keyword:`except` " "statements. The technique contrasts with the :term:`LBYL` style common to " "many other languages such as C." msgstr "" "「認可をとるより許しを請う方が容易 (easier to ask for forgiveness than " "permission、マーフィーの法則)」の略です。この Python " "で広く使われているコーディングスタイルでは、通常は有効なキーや属性が存在するものと仮定し、その仮定が誤っていた場合に例外を捕捉します。この簡潔で手早く書けるコーディングスタイルには、" " :keyword:`try` 文および :keyword:`except` 文がたくさんあるのが特徴です。このテクニックは、C " "のような言語でよく使われている :term:`LBYL` スタイルと対照的なものです。" #: ../../glossary.rst:366 msgid "expression" msgstr "expression" #: ../../glossary.rst:368 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " "attribute access, operators or function calls which all return a value. In " "contrast to many other languages, not all language constructs are " "expressions. There are also :term:`statement`\\s which cannot be used as " "expressions, such as :keyword:`while`. Assignments are also statements, not" " expressions." msgstr "" "(式) 何かの値と評価される、一まとまりの構文 (a piece of syntax) " "です。言い換えると、式とはリテラル、名前、属性アクセス、演算子や関数呼び出しなど、値を返す式の要素の積み重ねです。他の多くの言語と違い、Python " "では言語の全ての構成要素が式というわけではありません。 :keyword:`while` のように、式としては使えない :term:`文 " "` もあります。代入も式ではなく文です。" #: ../../glossary.rst:375 msgid "extension module" msgstr "extension module" #: ../../glossary.rst:377 msgid "" "A module written in C or C++, using Python's C API to interact with the core" " and with user code." msgstr "" "(拡張モジュール) C や C++ で書かれたモジュールで、Python の C API を利用して Python " "コアやユーザーコードとやりとりします。" #: ../../glossary.rst:379 msgid "f-string" msgstr "f-string" #: ../../glossary.rst:381 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called " "\"f-strings\" which is short for :ref:`formatted string literals " "`. See also :pep:`498`." msgstr "" "``'f'`` や ``'F'`` が先頭に付いた文字列リテラルは \"f-string\" と呼ばれ、これは :ref:`フォーマット済み文字列リテラル ` の短縮形の名称です。\n" ":pep:`498` も参照してください。" #: ../../glossary.rst:384 msgid "file object" msgstr "file object" #: ../../glossary.rst:386 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`read()` " "or :meth:`write()`) to an underlying resource. Depending on the way it was " "created, a file object can mediate access to a real on-disk file or to " "another type of storage or communication device (for example standard " "input/output, in-memory buffers, sockets, pipes, etc.). File objects are " "also called :dfn:`file-like objects` or :dfn:`streams`." msgstr "" "(ファイルオブジェクト) 下位のリソースへのファイル指向 API (:meth:`read()` や :meth:`write()` " "メソッドを持つもの) " "を公開しているオブジェクトです。ファイルオブジェクトは、作成された手段によって、実際のディスク上のファイルや、その他のタイプのストレージや通信デバイス " "(例えば、標準入出力、インメモリバッファ、ソケット、パイプ、等) へのアクセスを媒介できます。ファイルオブジェクトは :dfn:`file-like " "objects` や :dfn:`streams` とも呼ばれます。" #: ../../glossary.rst:394 msgid "" "There are actually three categories of file objects: raw :term:`binary files" " `, buffered :term:`binary files ` and :term:`text" " files `. Their interfaces are defined in the :mod:`io` module. " "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" "ファイルオブジェクトには実際には 3 種類あります: 生の :term:`バイナリーファイル `、バッファされた " ":term:`バイナリーファイル `、そして :term:`テキストファイル` です。インターフェイスは" " :mod:`io` モジュールで定義されています。ファイルオブジェクトを作る標準的な方法は :func:`open` 関数を使うことです。" #: ../../glossary.rst:399 msgid "file-like object" msgstr "file-like object" #: ../../glossary.rst:401 msgid "A synonym for :term:`file object`." msgstr ":term:`file object` と同義です。" #: ../../glossary.rst:402 msgid "filesystem encoding and error handler" msgstr "" #: ../../glossary.rst:404 msgid "" "Encoding and error handler used by Python to decode bytes from the operating" " system and encode Unicode to the operating system." msgstr "" #: ../../glossary.rst:407 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " "functions can raise :exc:`UnicodeError`." msgstr "" #: ../../glossary.rst:411 msgid "" "The :func:`sys.getfilesystemencoding` and " ":func:`sys.getfilesystemencodeerrors` functions can be used to get the " "filesystem encoding and error handler." msgstr "" #: ../../glossary.rst:415 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see " ":c:member:`~PyConfig.filesystem_encoding` and " ":c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" #: ../../glossary.rst:420 msgid "See also the :term:`locale encoding`." msgstr "" #: ../../glossary.rst:421 msgid "finder" msgstr "finder" #: ../../glossary.rst:423 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "(ファインダ)\n" "インポートされているモジュールの :term:`loader` の発見を試行するオブジェクトです。" #: ../../glossary.rst:426 msgid "" "Since Python 3.3, there are two types of finder: :term:`meta path finders " "` for use with :data:`sys.meta_path`, and :term:`path " "entry finders ` for use with :data:`sys.path_hooks`." msgstr "" "Python 3.3 以降では 2 種類のファインダがあります。\n" ":data:`sys.meta_path` で使用される :term:`meta path finder` と、\n" ":data:`sys.path_hooks` で使用される :term:`path entry finder` です。" #: ../../glossary.rst:430 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." msgstr "詳細については :pep:`302`、:pep:`420` および :pep:`451` を参照してください。" #: ../../glossary.rst:431 msgid "floor division" msgstr "floor division" #: ../../glossary.rst:433 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " "evaluates to ``2`` in contrast to the ``2.75`` returned by float true " "division. Note that ``(-11) // 4`` is ``-3`` because that is ``-2.75`` " "rounded *downward*. See :pep:`238`." msgstr "" "(切り捨て除算) 一番近い整数に切り捨てる数学的除算。\n" "切り捨て除算演算子は ``//`` です。\n" "例えば、 ``11 // 4`` は ``2`` になり、それとは対称に浮動小数点数の真の除算では ``2.75`` が 返ってきます。\n" "``(-11) // 4`` は ``-2.75`` を *小さい方に* 丸める (訳注: 負の無限大への丸めを行う) ので ``-3`` になることに注意してください。\n" ":pep:`238` を参照してください。" #: ../../glossary.rst:438 msgid "function" msgstr "関数" #: ../../glossary.rst:440 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " "execution of the body. See also :term:`parameter`, :term:`method`, and the " ":ref:`function` section." msgstr "" "(関数) 呼び出し側に値を返す一連の文のことです。関数には0以上の :term:`実引数 ` " "を渡すことが出来ます。実体の実行時に引数を使用することが出来ます。 :term:`仮引数 `、:term:`メソッド " "`、:ref:`function` を参照してください。" #: ../../glossary.rst:444 msgid "function annotation" msgstr "function annotation" #: ../../glossary.rst:446 msgid "An :term:`annotation` of a function parameter or return value." msgstr "(関数アノテーション) 関数のパラメータや返り値の :term:`annotation` です。" #: ../../glossary.rst:448 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " "and is also expected to have an :class:`int` return value::" msgstr "" "関数アノテーションは、通常は :term:`型ヒント ` のために使われます: 例えば、この関数は 2 つの " ":class:`int` 型の引数を取ると期待され、また :class:`int` 型の返り値を持つと期待されています。" #: ../../glossary.rst:456 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "関数アノテーションの文法は :ref:`function` の節で解説されています。" #: ../../glossary.rst:458 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " "working with annotations." msgstr "" #: ../../glossary.rst:462 msgid "__future__" msgstr "__future__" #: ../../glossary.rst:464 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics" " that will become standard in a future release of Python. The " ":mod:`__future__` module documents the possible values of *feature*. By " "importing this module and evaluating its variables, you can see when a new " "feature was first added to the language and when it will (or did) become the" " default::" msgstr "" #: ../../glossary.rst:475 msgid "garbage collection" msgstr "garbage collection" #: ../../glossary.rst:477 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " "that is able to detect and break reference cycles. The garbage collector " "can be controlled using the :mod:`gc` module." msgstr "" "(ガベージコレクション) これ以降使われることのないメモリを解放する処理です。\n" "Pythonは、参照カウントと、循環参照を検出し破壊する循環ガベージコレクタを使ってガベージコレクションを行います。\n" "ガベージコレクタは :mod:`gc` モジュールを使って操作できます。" #: ../../glossary.rst:483 msgid "generator" msgstr "ジェネレータ" #: ../../glossary.rst:485 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " "producing a series of values usable in a for-loop or that can be retrieved " "one at a time with the :func:`next` function." msgstr "" "(ジェネレータ)\n" ":term:`generator iterator` を返す関数です。\n" "通常の関数に似ていますが、 :keyword:`yield` 式を持つ点で異なります。\n" ":keyword:`yield` 式は、 for ループで使用できたり、:func:`next` 関数で値を 1 つずつ取り出したりできる、値の並びを生成するのに使用されます。" #: ../../glossary.rst:490 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " "clear, using the full terms avoids ambiguity." msgstr "" "通常はジェネレータ関数を指しますが、文脈によっては *ジェネレータイテレータ* を指す場合があります。\n" "意図された意味が明らかでない場合、 明瞭化のために完全な単語を使用します。" #: ../../glossary.rst:493 msgid "generator iterator" msgstr "generator iterator" #: ../../glossary.rst:495 msgid "An object created by a :term:`generator` function." msgstr "" "(ジェネレータイテレータ)\n" ":term:`generator` 関数で生成されるオブジェクトです。" #: ../../glossary.rst:497 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" "statements). When the *generator iterator* resumes, it picks up where it " "left off (in contrast to functions which start fresh on every invocation)." msgstr "" ":keyword:`yield` のたびに局所実行状態 (局所変数や未処理の try 文などを含む) を記憶して、処理は一時的に中断されます。\n" "*ジェネレータイテレータ* が再開されると、中断した位置を取得します (通常の関数が実行のたびに新しい状態から開始するのと対照的です)。" #: ../../glossary.rst:504 msgid "generator expression" msgstr "generator expression" #: ../../glossary.rst:506 msgid "" "An expression that returns an iterator. It looks like a normal expression " "followed by a :keyword:`!for` clause defining a loop variable, range, and an" " optional :keyword:`!if` clause. The combined expression generates values " "for an enclosing function::" msgstr "" "(ジェネレータ式) イテレータを返す式です。\n" "普通の式に、ループ変数を定義する :keyword:`!for` 節、範囲、そして省略可能な :keyword:`!if` 節がつづいているように見えます。\n" "こうして構成された式は、外側の関数に向けて値を生成します::" #: ../../glossary.rst:513 msgid "generic function" msgstr "generic function" #: ../../glossary.rst:515 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " "determined by the dispatch algorithm." msgstr "" "(ジェネリック関数) " "異なる型に対し同じ操作をする関数群から構成される関数です。呼び出し時にどの実装を用いるかはディスパッチアルゴリズムにより決定されます。" #: ../../glossary.rst:519 msgid "" "See also the :term:`single dispatch` glossary entry, the " ":func:`functools.singledispatch` decorator, and :pep:`443`." msgstr "" ":term:`single dispatch`、:func:`functools.singledispatch` デコレータ、:pep:`443` " "を参照してください。" #: ../../glossary.rst:521 msgid "generic type" msgstr "" #: ../../glossary.rst:523 msgid "" "A :term:`type` that can be parameterized; typically a container like " ":class:`list`. Used for :term:`type hints ` and " ":term:`annotations `." msgstr "" #: ../../glossary.rst:527 msgid "" "See :pep:`483` for more details, and :mod:`typing` or :ref:`generic alias " "type ` for its uses." msgstr "" #: ../../glossary.rst:529 msgid "GIL" msgstr "GIL" #: ../../glossary.rst:531 msgid "See :term:`global interpreter lock`." msgstr ":term:`global interpreter lock` を参照してください。" #: ../../glossary.rst:532 msgid "global interpreter lock" msgstr "global interpreter lock" #: ../../glossary.rst:534 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " "CPython implementation by making the object model (including critical built-" "in types such as :class:`dict`) implicitly safe against concurrent access. " "Locking the entire interpreter makes it easier for the interpreter to be " "multi-threaded, at the expense of much of the parallelism afforded by multi-" "processor machines." msgstr "" "(グローバルインタプリタロック) :term:`CPython` インタプリタが利用している、一度に Python の :term:`バイトコード " "` を実行するスレッドは一つだけであることを保証する仕組みです。これにより (:class:`dict` " "などの重要な組み込み型を含む) オブジェクトモデルが同時アクセスに対して暗黙的に安全になるので、 CPython " "の実装がシンプルになります。インタプリタ全体をロックすることで、マルチプロセッサマシンが生じる並列化のコストと引き換えに、インタプリタを簡単にマルチスレッド化できるようになります。" #: ../../glossary.rst:543 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally-intensive tasks" " such as compression or hashing. Also, the GIL is always released when " "doing I/O." msgstr "" "ただし、標準あるいは外部のいくつかの拡張モジュールは、圧縮やハッシュ計算などの計算の重い処理をするときに GIL " "を解除するように設計されています。また、I/O 処理をする場合 GIL は常に解除されます。" #: ../../glossary.rst:548 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " "performance suffered in the common single-processor case. It is believed " "that overcoming this performance issue would make the implementation much " "more complicated and therefore costlier to maintain." msgstr "" "過去に \"自由なマルチスレッド化\" したインタプリタ (供用されるデータを細かい粒度でロックする) " "が開発されましたが、一般的なシングルプロセッサの場合のパフォーマンスが悪かったので成功しませんでした。このパフォーマンスの問題を克服しようとすると、実装がより複雑になり保守コストが増加すると考えられています。" #: ../../glossary.rst:554 msgid "hash-based pyc" msgstr "hash-based pyc" #: ../../glossary.rst:556 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" "invalidation`." msgstr "" "(ハッシュベース pyc ファイル) " "正当性を判別するために、対応するソースファイルの最終更新時刻ではなくハッシュ値を使用するバイトコードのキャッシュファイルです。" #: ../../glossary.rst:559 msgid "hashable" msgstr "hashable" #: ../../glossary.rst:561 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`__hash__` method), and can be compared to " "other objects (it needs an :meth:`__eq__` method). Hashable objects which " "compare equal must have the same hash value." msgstr "" "(ハッシュ可能) *ハッシュ可能* なオブジェクトとは、生存期間中変わらないハッシュ値を持ち (:meth:`__hash__` " "メソッドが必要)、他のオブジェクトと比較ができる (:meth:`__eq__` メソッドが必要) " "オブジェクトです。同値なハッシュ可能オブジェクトは必ず同じハッシュ値を持つ必要があります。" #: ../../glossary.rst:566 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." msgstr "ハッシュ可能なオブジェクトは辞書のキーや集合のメンバーとして使えます。辞書や集合のデータ構造は内部でハッシュ値を使っているからです。" #: ../../glossary.rst:569 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers" " (such as lists or dictionaries) are not; immutable containers (such as " "tuples and frozensets) are only hashable if their elements are hashable. " "Objects which are instances of user-defined classes are hashable by default." " They all compare unequal (except with themselves), and their hash value is" " derived from their :func:`id`." msgstr "" "Python のイミュータブルな組み込みオブジェクトは、ほとんどがハッシュ可能です。(リストや辞書のような) ミュータブルなコンテナはハッシュ不可能です。(タプルや frozenset のような) イミュータブルなコンテナは、要素がハッシュ可能であるときのみハッシュ可能です。\n" "ユーザー定義のクラスのインスタンスであるようなオブジェクトはデフォルトでハッシュ可能です。\n" "それらは全て (自身を除いて) 比較結果は非等価であり、ハッシュ値は :func:`id` より得られます。" #: ../../glossary.rst:576 msgid "IDLE" msgstr "IDLE" #: ../../glossary.rst:578 msgid "" "An Integrated Development Environment for Python. IDLE is a basic editor " "and interpreter environment which ships with the standard distribution of " "Python." msgstr "" "Python の統合開発環境 (Integrated DeveLopment Environment) です。IDLE は Python " "の標準的な配布に同梱されている基本的な機能のエディタとインタプリタ環境です。" #: ../../glossary.rst:581 msgid "immutable" msgstr "immutable" #: ../../glossary.rst:583 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " "created if a different value has to be stored. They play an important role " "in places where a constant hash value is needed, for example as a key in a " "dictionary." msgstr "" "(イミュータブル) " "固定の値を持ったオブジェクトです。イミュータブルなオブジェクトには、数値、文字列、およびタプルなどがあります。これらのオブジェクトは値を変えられません。別の値を記憶させる際には、新たなオブジェクトを作成しなければなりません。イミュータブルなオブジェクトは、固定のハッシュ値が必要となる状況で重要な役割を果たします。辞書のキーがその例です。" #: ../../glossary.rst:588 msgid "import path" msgstr "import path" #: ../../glossary.rst:590 msgid "" "A list of locations (or :term:`path entries `) that are searched" " by the :term:`path based finder` for modules to import. During import, this" " list of locations usually comes from :data:`sys.path`, but for subpackages " "it may also come from the parent package's ``__path__`` attribute." msgstr "" ":term:`path based finder` が import するモジュールを検索する場所 (または :term:`path entry`) " "のリスト。 import 中、このリストは通常 :data:`sys.path` から来ますが、サブパッケージの場合は親パッケージの " "``__path__`` 属性からも来ます。" #: ../../glossary.rst:595 msgid "importing" msgstr "importing" #: ../../glossary.rst:597 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." msgstr "あるモジュールの Python コードが別のモジュールの Python コードで使えるようにする処理です。" #: ../../glossary.rst:599 msgid "importer" msgstr "importer" #: ../../glossary.rst:601 msgid "" "An object that both finds and loads a module; both a :term:`finder` and " ":term:`loader` object." msgstr "モジュールを探してロードするオブジェクト。 :term:`finder` と :term:`loader` のどちらでもあるオブジェクト。" #: ../../glossary.rst:603 msgid "interactive" msgstr "interactive" #: ../../glossary.rst:605 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " "their results. Just launch ``python`` with no arguments (possibly by " "selecting it from your computer's main menu). It is a very powerful way to " "test out new ideas or inspect modules and packages (remember ``help(x)``)." msgstr "" "(対話的) Python には対話的インタプリタがあり、文や式をインタプリタのプロンプトに入力すると即座に実行されて結果を見ることができます。 " "``python`` と何も引数を与えずに実行してください。(コンピュータのメインメニューから " "Pythonの対話的インタプリタを起動できるかもしれません。) " "対話的インタプリタは、新しいアイデアを試してみたり、モジュールやパッケージの中を覗いてみる(``help(x)`` を覚えておいてください) " "のに非常に便利なツールです。" #: ../../glossary.rst:611 msgid "interpreted" msgstr "interpreted" #: ../../glossary.rst:613 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler." " This means that source files can be run directly without explicitly " "creating an executable which is then run. Interpreted languages typically " "have a shorter development/debug cycle than compiled ones, though their " "programs generally also run more slowly. See also :term:`interactive`." msgstr "" "Python はインタプリタ形式の言語であり、コンパイラ言語の対極に位置します。 (バイトコードコンパイラがあるために、この区別は曖昧ですが。) " "ここでのインタプリタ言語とは、ソースコードのファイルを、まず実行可能形式にしてから実行させるといった操作なしに、直接実行できることを意味します。インタプリタ形式の言語は通常、コンパイラ形式の言語よりも開発/デバッグのサイクルは短いものの、プログラムの実行は一般に遅いです。" " :term:`対話的 ` も参照してください。" #: ../../glossary.rst:620 msgid "interpreter shutdown" msgstr "interpreter shutdown" #: ../../glossary.rst:622 msgid "" "When asked to shut down, the Python interpreter enters a special phase where" " it gradually releases all allocated resources, such as modules and various " "critical internal structures. It also makes several calls to the " ":term:`garbage collector `. This can trigger the " "execution of code in user-defined destructors or weakref callbacks. Code " "executed during the shutdown phase can encounter various exceptions as the " "resources it relies on may not function anymore (common examples are library" " modules or the warnings machinery)." msgstr "" "Python インタープリターはシャットダウンを要請された時に、モジュールやすべてのクリティカルな内部構造をなどの、すべての確保したリソースを段階的に開放する、特別なフェーズに入ります。\n" "このフェーズは :term:`ガベージコレクタ ` を複数回呼び出します。\n" "これによりユーザー定義のデストラクターや weakref コールバックが呼び出されることがあります。\n" "シャットダウンフェーズ中に実行されるコードは、それが依存するリソースがすでに機能しない(よくある例はライブラリーモジュールや warning 機構です) ために様々な例外に直面します。" #: ../../glossary.rst:631 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "インタープリタがシャットダウンする主な理由は ``__main__`` モジュールや実行されていたスクリプトの実行が終了したことです。" #: ../../glossary.rst:633 msgid "iterable" msgstr "iterable" #: ../../glossary.rst:635 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " "and :class:`tuple`) and some non-sequence types like :class:`dict`, " ":term:`file objects `, and objects of any classes you define " "with an :meth:`__iter__` method or with a :meth:`__getitem__` method that " "implements :term:`Sequence ` semantics." msgstr "" "(反復可能オブジェクト) 要素を一度に 1 つずつ返せるオブジェクトです。\n" "反復可能オブジェクトの例には、(:class:`list`, :class:`str`, :class:`tuple` といった) 全てのシーケンス型や、 :class:`dict` や :term:`ファイルオブジェクト ` といった幾つかの非シーケンス型、 あるいは :term:`Sequence ` 意味論を実装した :meth:`__iter__` メソッドか :meth:`__getitem__` メソッドを持つ任意のクラスのインスタンスが含まれます。" #: ../../glossary.rst:642 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " "iterable object is passed as an argument to the built-in function " ":func:`iter`, it returns an iterator for the object. This iterator is good " "for one pass over the set of values. When using iterables, it is usually " "not necessary to call :func:`iter` or deal with iterator objects yourself. " "The ``for`` statement does that automatically for you, creating a temporary " "unnamed variable to hold the iterator for the duration of the loop. See " "also :term:`iterator`, :term:`sequence`, and :term:`generator`." msgstr "" "反復可能オブジェクトは :keyword:`for` ループ内やその他多くのシーケンス (訳注: ここでのシーケンスとは、シーケンス型ではなくただの列という意味)が必要となる状況 (:func:`zip`, :func:`map`, ...) で利用できます。\n" "反復可能オブジェクトを組み込み関数 :func:`iter` の引数として渡すと、 オブジェクトに対するイテレータを返します。\n" "このイテレータは一連の値を引き渡す際に便利です。\n" "通常は反復可能オブジェクトを使う際には、 :func:`iter` を呼んだりイテレータオブジェクトを自分で操作する必要はありません。\n" "``for`` 文ではこの操作を自動的に行い、一時的な無名の変数を作成してループを回している間イテレータを保持します。\n" ":term:`イテレータ ` 、 :term:`シーケンス ` 、 :term:`ジェネレータ ` も参照してください。 " #: ../../glossary.rst:652 msgid "iterator" msgstr "iterator" #: ../../glossary.rst:654 msgid "" "An object representing a stream of data. Repeated calls to the iterator's " ":meth:`~iterator.__next__` method (or passing it to the built-in function " ":func:`next`) return successive items in the stream. When no more data are " "available a :exc:`StopIteration` exception is raised instead. At this " "point, the iterator object is exhausted and any further calls to its " ":meth:`__next__` method just raise :exc:`StopIteration` again. Iterators " "are required to have an :meth:`__iter__` method that returns the iterator " "object itself so every iterator is also iterable and may be used in most " "places where other iterables are accepted. One notable exception is code " "which attempts multiple iteration passes. A container object (such as a " ":class:`list`) produces a fresh new iterator each time you pass it to the " ":func:`iter` function or use it in a :keyword:`for` loop. Attempting this " "with an iterator will just return the same exhausted iterator object used in" " the previous iteration pass, making it appear like an empty container." msgstr "" "(イテレータ) データの流れを表現するオブジェクトです。イテレータの :meth:`~iterator.__next__` メソッドを繰り返し呼び出す " "(または組み込み関数 :func:`next` に渡す) と、流れの中の要素を一つずつ返します。データがなくなると、代わりに " ":exc:`StopIteration` 例外を送出します。その時点で、イテレータオブジェクトは尽きており、それ以降は :meth:`__next__`" " を何度呼んでも :exc:`StopIteration` を送出します。イテレータは、そのイテレータオブジェクト自体を返す " ":meth:`__iter__` メソッドを実装しなければならないので、イテレータは他の iterable " "を受理するほとんどの場所で利用できます。はっきりとした例外は複数の反復を行うようなコードです。 (:class:`list` のような) " "コンテナオブジェクトは、自身を :func:`iter` 関数にオブジェクトに渡したり :keyword:`for` " "ループ内で使うたびに、新たな未使用のイテレータを生成します。これをイテレータで行おうとすると、前回のイテレーションで使用済みの同じイテレータオブジェクトを単純に返すため、空のコンテナのようになってしまします。" #: ../../glossary.rst:669 msgid "More information can be found in :ref:`typeiter`." msgstr "詳細な情報は :ref:`typeiter` にあります。" #: ../../glossary.rst:670 msgid "key function" msgstr "key function" #: ../../glossary.rst:672 msgid "" "A key function or collation function is a callable that returns a value used" " for sorting or ordering. For example, :func:`locale.strxfrm` is used to " "produce a sort key that is aware of locale specific sort conventions." msgstr "" "(キー関数) キー関数、あるいは照合関数とは、ソートや順序比較のための値を返す呼び出し可能オブジェクト(callable)です。例えば、 " ":func:`locale.strxfrm` をキー関数に使えば、ロケール依存のソートの慣習にのっとったソートキーを返します。" #: ../../glossary.rst:677 msgid "" "A number of tools in Python accept key functions to control how elements are" " ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`," " :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, " ":func:`heapq.nlargest`, and :func:`itertools.groupby`." msgstr "" "Python の多くのツールはキー関数を受け取り要素の並び順やグループ化を管理します。\n" ":func:`min`, :func:`max`, :func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, :func:`itertools.groupby` 等があります。" #: ../../glossary.rst:683 msgid "" "There are several ways to create a key function. For example. the " ":meth:`str.lower` method can serve as a key function for case insensitive " "sorts. Alternatively, a key function can be built from a :keyword:`lambda` " "expression such as ``lambda r: (r[0], r[2])``. Also, the :mod:`operator` " "module provides three key function constructors: " ":func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and " ":func:`~operator.methodcaller`. See the :ref:`Sorting HOW TO " "` for examples of how to create and use key functions." msgstr "" "キー関数を作る方法はいくつかあります。\n" "例えば :meth:`str.lower` メソッドを大文字小文字を区別しないソートを行うキー関数として使うことが出来ます。\n" "あるいは、``lambda r: (r[0], r[2])`` のような :keyword:`lambda` 式からキー関数を作ることができます。\n" "また、 :mod:`operator` モジュールは :func:`~operator.attrgetter`, :func:`~operator.itemgetter`, :func:`~operator.methodcaller` という 3 つのキー関数コンストラクタを提供しています。\n" "キー関数の作り方と使い方の例は :ref:`Sorting HOW TO ` を参照してください。" #: ../../glossary.rst:691 msgid "keyword argument" msgstr "keyword argument" #: ../../glossary.rst:693 ../../glossary.rst:982 msgid "See :term:`argument`." msgstr ":term:`実引数 ` を参照してください。" #: ../../glossary.rst:694 msgid "lambda" msgstr "lambda" #: ../../glossary.rst:696 msgid "" "An anonymous inline function consisting of a single :term:`expression` which" " is evaluated when the function is called. The syntax to create a lambda " "function is ``lambda [parameters]: expression``" msgstr "" "(ラムダ) 無名のインライン関数で、関数が呼び出されたときに評価される 1 つの :term:`式 ` " "を含みます。ラムダ関数を作る構文は ``lambda [parameters]: expression`` です。" #: ../../glossary.rst:699 msgid "LBYL" msgstr "LBYL" #: ../../glossary.rst:701 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions" " before making calls or lookups. This style contrasts with the :term:`EAFP`" " approach and is characterized by the presence of many :keyword:`if` " "statements." msgstr "" "「ころばぬ先の杖 (look before you leap)」 の略です。このコーディングスタイルでは、呼び出しや検索を行う前に、明示的に前提条件 " "(pre-condition) 判定を行います。 :term:`EAFP` アプローチと対照的で、 :keyword:`if` " "文がたくさん使われるのが特徴的です。" #: ../../glossary.rst:706 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " "the code, ``if key in mapping: return mapping[key]`` can fail if another " "thread removes *key* from *mapping* after the test, but before the lookup. " "This issue can be solved with locks or by using the EAFP approach." msgstr "" "マルチスレッド化された環境では、LBYL アプローチは \"見る\" 過程と \"飛ぶ\" 過程の競合状態を引き起こすリスクがあります。例えば、``if" " key in mapping: return mapping[key]`` というコードは、判定の後、別のスレッドが探索の前に *mapping* " "から *key* を取り除くと失敗します。この問題は、ロックするか EAFP アプローチを使うことで解決できます。" #: ../../glossary.rst:711 msgid "locale encoding" msgstr "" #: ../../glossary.rst:713 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with " "``locale.setlocale(locale.LC_CTYPE, new_locale)``." msgstr "" #: ../../glossary.rst:716 msgid "On Windows, it is the ANSI code page (ex: ``cp1252``)." msgstr "" #: ../../glossary.rst:718 msgid "" "``locale.getpreferredencoding(False)`` can be used to get the locale " "encoding." msgstr "" #: ../../glossary.rst:721 msgid "" "Python uses the :term:`filesystem encoding and error handler` to convert " "between Unicode filenames and bytes filenames." msgstr "" #: ../../glossary.rst:723 msgid "list" msgstr "list" #: ../../glossary.rst:725 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " "O(1)." msgstr "" "(リスト) Python の組み込みの :term:`シーケンス ` " "です。リストという名前ですが、リンクリストではなく、他の言語で言う配列 (array) と同種のもので、要素へのアクセスは O(1) です。" #: ../../glossary.rst:728 msgid "list comprehension" msgstr "list comprehension" #: ../../glossary.rst:730 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " "range(256) if x % 2 == 0]`` generates a list of strings containing even hex " "numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is " "optional. If omitted, all elements in ``range(256)`` are processed." msgstr "" "(リスト内包表記) シーケンス中の全てあるいは一部の要素を処理して、その結果からなるリストを返す、コンパクトな方法です。 ``result = " "['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` とすると、 0 から 255 " "までの偶数を 16進数表記 (0x..) した文字列からなるリストを生成します。 :keyword:`if` 節はオプションです。 " ":keyword:`if` 節がない場合、 ``range(256)`` の全ての要素が処理されます。" #: ../../glossary.rst:736 msgid "loader" msgstr "loader" #: ../../glossary.rst:738 msgid "" "An object that loads a module. It must define a method named " ":meth:`load_module`. A loader is typically returned by a :term:`finder`. See" " :pep:`302` for details and :class:`importlib.abc.Loader` for an " ":term:`abstract base class`." msgstr "" "モジュールをロードするオブジェクト。 :meth:`load_module` という名前のメソッドを定義していなければなりません。ローダーは一般的に " ":term:`finder` から返されます。詳細は :pep:`302` を、 :term:`abstract base class` については " ":class:`importlib.abc.Loader` を参照してください。" #: ../../glossary.rst:742 msgid "magic method" msgstr "magic method" #: ../../glossary.rst:746 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method` のくだけた同義語です。" #: ../../glossary.rst:747 msgid "mapping" msgstr "mapping" #: ../../glossary.rst:749 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`~collections.abc.Mapping` or " ":class:`~collections.abc.MutableMapping` :ref:`abstract base classes " "`. Examples include :class:`dict`, " ":class:`collections.defaultdict`, :class:`collections.OrderedDict` and " ":class:`collections.Counter`." msgstr "" "(マッピング) 任意のキー探索をサポートしていて、 :class:`~collections.abc.Mapping` か " ":class:`~collections.abc.MutableMapping` の :ref:`抽象基底クラス ` で指定されたメソッドを実装しているコンテナオブジェクトです。例えば、 :class:`dict`, " ":class:`collections.defaultdict`, :class:`collections.OrderedDict`, " ":class:`collections.Counter` などです。" #: ../../glossary.rst:755 msgid "meta path finder" msgstr "meta path finder" #: ../../glossary.rst:757 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders `." msgstr "" ":data:`sys.meta_path` を検索して得られた :term:`finder`.\n" "meta path finder は :term:`path entry finder` と関係はありますが、別物です。" #: ../../glossary.rst:761 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "meta path finder が実装するメソッドについては :class:`importlib.abc.MetaPathFinder` " "を参照してください。" #: ../../glossary.rst:763 msgid "metaclass" msgstr "metaclass" #: ../../glossary.rst:765 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " "taking those three arguments and creating the class. Most object oriented " "programming languages provide a default implementation. What makes Python " "special is that it is possible to create custom metaclasses. Most users " "never need this tool, but when the need arises, metaclasses can provide " "powerful, elegant solutions. They have been used for logging attribute " "access, adding thread-safety, tracking object creation, implementing " "singletons, and many other tasks." msgstr "" "(メタクラス) クラスのクラスです。クラス定義は、クラス名、クラスの辞書と、基底クラスのリストを作ります。メタクラスは、それら 3 " "つを引数として受け取り、クラスを作る責任を負います。ほとんどのオブジェクト指向言語は(訳注:メタクラスの)デフォルトの実装を提供しています。Python" " " "が特別なのはカスタムのメタクラスを作成できる点です。ほとんどのユーザーに取って、メタクラスは全く必要のないものです。しかし、一部の場面では、メタクラスは強力でエレガントな方法を提供します。たとえば属性アクセスのログを取ったり、スレッドセーフ性を追加したり、オブジェクトの生成を追跡したり、シングルトンを実装するなど、多くの場面で利用されます。" #: ../../glossary.rst:775 msgid "More information can be found in :ref:`metaclasses`." msgstr "詳細は :ref:`metaclasses` を参照してください。" #: ../../glossary.rst:776 msgid "method" msgstr "メソッド" #: ../../glossary.rst:778 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its" " first :term:`argument` (which is usually called ``self``). See " ":term:`function` and :term:`nested scope`." msgstr "" "(メソッド) クラス本体の中で定義された関数。そのクラスのインスタンスの属性として呼び出された場合、メソッドはインスタンスオブジェクトを第一 " ":term:`引数 ` として受け取ります (この第一引数は通常 ``self`` と呼ばれます)。 :term:`関数 " "` と :term:`ネストされたスコープ ` も参照してください。" #: ../../glossary.rst:782 msgid "method resolution order" msgstr "method resolution order" #: ../../glossary.rst:784 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See `The Python 2.3 Method Resolution Order " "`_ for details of the " "algorithm used by the Python interpreter since the 2.3 release." msgstr "" "(メソッド解決順序)\n" "探索中に基底クラスが構成要素を検索される順番です。\n" "2.3 以降の Python インタープリタが使用するアルゴリズムの詳細については `The Python 2.3 Method Resolution Order `_ を参照してください。" #: ../../glossary.rst:788 msgid "module" msgstr "module" #: ../../glossary.rst:790 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " "into Python by the process of :term:`importing`." msgstr "" "(モジュール) Python コードの組織単位としてはたらくオブジェクトです。モジュールは任意の Python " "オブジェクトを含む名前空間を持ちます。モジュールは :term:`importing` の処理によって Python に読み込まれます。" #: ../../glossary.rst:794 msgid "See also :term:`package`." msgstr ":term:`パッケージ ` を参照してください。" #: ../../glossary.rst:795 msgid "module spec" msgstr "module spec" #: ../../glossary.rst:797 msgid "" "A namespace containing the import-related information used to load a module." " An instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" "モジュールをロードするのに使われるインポート関連の情報を含む名前空間です。\n" ":class:`importlib.machinery.ModuleSpec` のインスタンスです。" #: ../../glossary.rst:799 msgid "MRO" msgstr "MRO" #: ../../glossary.rst:801 msgid "See :term:`method resolution order`." msgstr ":term:`method resolution order` を参照してください。" #: ../../glossary.rst:802 msgid "mutable" msgstr "mutable" #: ../../glossary.rst:804 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also " ":term:`immutable`." msgstr "" "(ミュータブル) ミュータブルなオブジェクトは、 :func:`id` を変えることなく値を変更できます。 :term:`イミュータブル " "`) も参照してください。" #: ../../glossary.rst:806 msgid "named tuple" msgstr "named tuple" #: ../../glossary.rst:808 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " "attributes. The type or class may have other features as well." msgstr "" "\"名前付きタプル\" という用語は、タプルを継承していて、インデックスが付く要素に対し属性を使ってのアクセスもできる任意の型やクラスに応用されています。\n" "その型やクラスは他の機能も持っていることもあります。" #: ../../glossary.rst:812 msgid "" "Several built-in types are named tuples, including the values returned by " ":func:`time.localtime` and :func:`os.stat`. Another example is " ":data:`sys.float_info`::" msgstr "" ":func:`time.localtime` や :func:`os.stat` の返り値を含むいくつかの組み込み型は名前付きタプルです。\n" "他の例は :data:`sys.float_info` です::" #: ../../glossary.rst:823 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " "that inherits from :class:`tuple` and that defines named fields. Such a " "class can be written by hand or it can be created with the factory function " ":func:`collections.namedtuple`. The latter technique also adds some extra " "methods that may not be found in hand-written or built-in named tuples." msgstr "" "(上の例のように) いくつかの名前付きタプルは組み込み型になっています。\n" "その他にも名前付きタプルは、通常のクラス定義で :class:`tuple` を継承し、名前のフィールドを定義して作成できます。\n" "そのようなクラスは手動で書いたり、 :func:`collections.namedtuple` ファクトリ関数で作成したりできます。\n" "後者の方法は、手動で書いた名前付きタプルや組み込みの名前付きタプルには無い付加的なメソッドを追加できます。" #: ../../glossary.rst:830 msgid "namespace" msgstr "namespace" #: ../../glossary.rst:832 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " "as nested namespaces in objects (in methods). Namespaces support modularity" " by preventing naming conflicts. For instance, the functions " ":func:`builtins.open <.open>` and :func:`os.open` are distinguished by their" " namespaces. Namespaces also aid readability and maintainability by making " "it clear which module implements a function. For instance, writing " ":func:`random.seed` or :func:`itertools.islice` makes it clear that those " "functions are implemented by the :mod:`random` and :mod:`itertools` modules," " respectively." msgstr "" "(名前空間) 変数が格納される場所です。名前空間は辞書として実装されます。名前空間にはオブジェクトの (メソッドの) " "入れ子になったものだけでなく、局所的なもの、大域的なもの、そして組み込みのものがあります。名前空間は名前の衝突を防ぐことによってモジュール性をサポートする。例えば関数" " :func:`builtins.open <.open>` と :func:`os.open` " "は名前空間で区別されています。また、どのモジュールが関数を実装しているか明示することによって名前空間は可読性と保守性を支援します。例えば、:func:`random.seed`" " や :func:`itertools.islice` と書くと、それぞれモジュール :mod:`random` や :mod:`itertools` " "で実装されていることが明らかです。" #: ../../glossary.rst:842 msgid "namespace package" msgstr "namespace package" #: ../../glossary.rst:844 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " "specifically are not like a :term:`regular package` because they have no " "``__init__.py`` file." msgstr "" "(名前空間パッケージ) サブパッケージのコンテナとしてのみ提供される :pep:`420` で定義された :term:`package` " "です。名前空間パッケージは物理的な表現を持たないことができ、 ``__init__.py`` ファイルを持たないため、 :term:`regular " "package` とは異なります。" #: ../../glossary.rst:849 msgid "See also :term:`module`." msgstr ":term:`module` を参照してください。" #: ../../glossary.rst:850 msgid "nested scope" msgstr "nested scope" #: ../../glossary.rst:852 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " "in the outer function. Note that nested scopes by default work only for " "reference and not for assignment. Local variables both read and write in " "the innermost scope. Likewise, global variables read and write to the " "global namespace. The :keyword:`nonlocal` allows writing to outer scopes." msgstr "" "(ネストされたスコープ) " "外側で定義されている変数を参照する機能です。例えば、ある関数が別の関数の中で定義されている場合、内側の関数は外側の関数中の変数を参照できます。ネストされたスコープはデフォルトでは変数の参照だけができ、変数の代入はできないので注意してください。ローカル変数は、最も内側のスコープで変数を読み書きします。同様に、グローバル変数を使うとグローバル名前空間の値を読み書きします。" " :keyword:`nonlocal` で外側の変数に書き込めます。" #: ../../glossary.rst:859 msgid "new-style class" msgstr "new-style class" #: ../../glossary.rst:861 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " "versatile features like :attr:`~object.__slots__`, descriptors, properties, " ":meth:`__getattribute__`, class methods, and static methods." msgstr "" "(新スタイルクラス) 今では全てのクラスオブジェクトに使われている味付けの古い名前です。以前の Python のバージョンでは、新スタイルクラスのみが " ":attr:`~object.__slots__` 、デスクリプタ、 :meth:`__getattribute__` " "、クラスメソッド、そして静的メソッド等の Python の新しい、多様な機能を利用できました。" #: ../../glossary.rst:865 msgid "object" msgstr "object" #: ../../glossary.rst:867 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." msgstr "" "(オブジェクト) 状態 (属性や値) と定義された振る舞い (メソッド) をもつ全てのデータ。もしくは、全ての :term:`新スタイルクラス " "` の究極の基底クラスのこと。" #: ../../glossary.rst:870 msgid "package" msgstr "package" #: ../../glossary.rst:872 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with an ``__path__``" " attribute." msgstr "" "(パッケージ) サブモジュールや再帰的にサブパッケージを含むことの出来る :term:`module` のことです。専門的には、パッケージは " "``__path__`` 属性を持つ Python オブジェクトです。" #: ../../glossary.rst:876 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr ":term:`regular package` と :term:`namespace package` を参照してください。" #: ../../glossary.rst:877 msgid "parameter" msgstr "parameter" #: ../../glossary.rst:879 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " "accept. There are five kinds of parameter:" msgstr "" "(仮引数) 名前付の実体で :term:`関数` (や :term:`メソッド` ) の定義において関数が受ける " ":term:`実引数` を指定します。仮引数には5種類あります:" #: ../../glossary.rst:883 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " "`. This is the default kind of parameter, for example *foo* and " "*bar* in the following::" msgstr "" ":dfn:`位置またはキーワード`: :term:`位置 ` であるいは :term:`キーワード引数 ` として渡すことができる引数を指定します。\n" "これはたとえば以下の *foo* や *bar* のように、デフォルトの仮引数の種類です::" #: ../../glossary.rst:892 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " "character in the parameter list of the function definition after them, for " "example *posonly1* and *posonly2* in the following::" msgstr "" "位置専用: 位置によってのみ与えられる引数を指定します。位置専用の引数は 関数定義の引数のリストの中でそれらの後ろに ``/`` " "を含めることで定義できます。例えば下記の *posonly1* と *posonly2* は位置専用引数になります:: " #: ../../glossary.rst:901 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" "positional parameter or bare ``*`` in the parameter list of the function " "definition before them, for example *kw_only1* and *kw_only2* in the " "following::" msgstr "" ":dfn:`キーワード専用`: キーワードによってのみ与えられる引数を指定します。キーワード専用の引数を定義できる場所は、例えば以下の " "*kw_only1* や *kw_only2* のように、関数定義の仮引数リストに含めた可変長位置引数または裸の ``*`` の後です::" #: ../../glossary.rst:909 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " "accepted by other parameters). Such a parameter can be defined by " "prepending the parameter name with ``*``, for example *args* in the " "following::" msgstr "" ":dfn:`可変長位置`: (他の仮引数で既に受けられた任意の位置引数に加えて) " "任意の個数の位置引数が与えられることを指定します。このような仮引数は、以下の *args* のように仮引数名の前に ``*`` " "をつけることで定義できます::" #: ../../glossary.rst:917 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be" " provided (in addition to any keyword arguments already accepted by other " "parameters). Such a parameter can be defined by prepending the parameter " "name with ``**``, for example *kwargs* in the example above." msgstr "" ":dfn:`可変長キーワード`: (他の仮引数で既に受けられた任意のキーワード引数に加えて) " "任意の個数のキーワード引数が与えられることを指定します。このような仮引数は、上の例の *kwargs* のように仮引数名の前に ``**`` " "をつけることで定義できます。" #: ../../glossary.rst:923 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "仮引数はオプションと必須の引数のどちらも指定でき、オプションの引数にはデフォルト値も指定できます。" #: ../../glossary.rst:926 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " "the :class:`inspect.Parameter` class, the :ref:`function` section, and " ":pep:`362`." msgstr "" ":term:`仮引数 ` 、FAQ の :ref:`実引数と仮引数の違いは何ですか? ` 、:class:`inspect.Parameter` クラス、 :ref:`function` " "セクション、:pep:`362` を参照してください。" #: ../../glossary.rst:930 msgid "path entry" msgstr "path entry" #: ../../glossary.rst:932 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." msgstr "" ":term:`path based finder` が import するモジュールを探す :term:`import path` 上の1つの場所です。" #: ../../glossary.rst:934 msgid "path entry finder" msgstr "path entry finder" #: ../../glossary.rst:936 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a " ":term:`path entry hook`) which knows how to locate modules given a " ":term:`path entry`." msgstr "" ":data:`sys.path_hooks` にある callable (つまり :term:`path entry hook`) が返した " ":term:`finder` です。与えられた :term:`path entry` にあるモジュールを見つける方法を知っています。" #: ../../glossary.rst:940 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" "パスエントリーファインダが実装するメソッドについては :class:`importlib.abc.PathEntryFinder` を参照してください。" #: ../../glossary.rst:942 msgid "path entry hook" msgstr "path entry hook" #: ../../glossary.rst:944 msgid "" "A callable on the :data:`sys.path_hook` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " "entry`." msgstr "" ":data:`sys.path_hook` リストにある callable で、指定された :term:`path entry` " "にあるモジュールを見つける方法を知っている場合に :term:`path entry finder` を返します。" #: ../../glossary.rst:947 msgid "path based finder" msgstr "path based finder" #: ../../glossary.rst:949 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." msgstr "" "デフォルトの :term:`meta path finder` の1つは、モジュールの :term:`import path` を検索します。" #: ../../glossary.rst:951 msgid "path-like object" msgstr "path-like object" #: ../../glossary.rst:953 msgid "" "An object representing a file system path. A path-like object is either a " ":class:`str` or :class:`bytes` object representing a path, or an object " "implementing the :class:`os.PathLike` protocol. An object that supports the " ":class:`os.PathLike` protocol can be converted to a :class:`str` or " ":class:`bytes` file system path by calling the :func:`os.fspath` function; " ":func:`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a " ":class:`str` or :class:`bytes` result instead, respectively. Introduced by " ":pep:`519`." msgstr "" "(path-like オブジェクト) ファイルシステムパスを表します。\n" "path-like オブジェクトは、パスを表す :class:`str` オブジェクトや :class:`bytes` オブジェクト、または :class:`os.PathLike` プロトコルを実装したオブジェクトのどれかです。\n" ":class:`os.PathLike` プロトコルをサポートしているオブジェクトは :func:`os.fspath` を呼び出すことで :class:`str` または :class:`bytes` のファイルシステムパスに変換できます。 :func:`os.fsdecode` と :func:`os.fsencode` はそれぞれ :class:`str` あるいは :class:`bytes` になるのを保証するのに使えます。\n" ":pep:`519` で導入されました。" #: ../../glossary.rst:961 msgid "PEP" msgstr "PEP" #: ../../glossary.rst:963 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " "or its processes or environment. PEPs should provide a concise technical " "specification and a rationale for proposed features." msgstr "" "Python Enhancement Proposal。PEP は、Python コミュニティに対して情報を提供する、あるいは Python の新機能やその過程や環境について記述する設計文書です。\n" "PEP は、機能についての簡潔な技術的仕様と提案する機能の論拠 (理論) を伝えるべきです。" #: ../../glossary.rst:969 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " "the design decisions that have gone into Python. The PEP author is " "responsible for building consensus within the community and documenting " "dissenting opinions." msgstr "" "PEP は、新機能の提案にかかる、コミュニティによる問題提起の集積と Python " "になされる設計決断の文書化のための最上位の機構となることを意図しています。PEP " "の著者にはコミュニティ内の合意形成を行うこと、反対意見を文書化することの責務があります。" #: ../../glossary.rst:975 msgid "See :pep:`1`." msgstr ":pep:`1` を参照してください。" #: ../../glossary.rst:976 msgid "portion" msgstr "portion" #: ../../glossary.rst:978 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." msgstr "" ":pep:`420` で定義されている、namespace package に属する、複数のファイルが (zipファイルに格納されている場合もある) " "1つのディレクトリに格納されたもの。" #: ../../glossary.rst:980 msgid "positional argument" msgstr "位置引数 (positional argument)" #: ../../glossary.rst:983 msgid "provisional API" msgstr "provisional API" #: ../../glossary.rst:985 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " "to such interfaces are not expected, as long as they are marked provisional," " backwards incompatible changes (up to and including removal of the " "interface) may occur if deemed necessary by core developers. Such changes " "will not be made gratuitously -- they will occur only if serious fundamental" " flaws are uncovered that were missed prior to the inclusion of the API." msgstr "" "(暫定 API) " "標準ライブラリの後方互換性保証から計画的に除外されたものです。そのようなインターフェースへの大きな変更は、暫定であるとされている間は期待されていませんが、コア開発者によって必要とみなされれば、後方非互換な変更" " (インターフェースの削除まで含まれる) が行われえます。このような変更はむやみに行われるものではありません -- これは API " "を組み込む前には見落とされていた重大な欠陥が露呈したときにのみ行われます。" #: ../../glossary.rst:994 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " "backwards compatible resolution to any identified problems." msgstr "暫定 API についても、後方互換性のない変更は「最終手段」とみなされています。問題点が判明した場合でも後方互換な解決策を探すべきです。" #: ../../glossary.rst:998 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " "See :pep:`411` for more details." msgstr "" "このプロセスにより、標準ライブラリは問題となるデザインエラーに長い間閉じ込められることなく、時代を超えて進化を続けられます。詳細は :pep:`411`" " を参照してください。" #: ../../glossary.rst:1001 msgid "provisional package" msgstr "provisional package" #: ../../glossary.rst:1003 msgid "See :term:`provisional API`." msgstr ":term:`provisional API` を参照してください。" #: ../../glossary.rst:1004 msgid "Python 3000" msgstr "Python 3000" #: ../../glossary.rst:1006 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated" " \"Py3k\"." msgstr "" "Python 3.x リリースラインのニックネームです。(Python 3 が遠い将来の話だった頃に作られた言葉です。) \"Py3k\" " "と略されることもあります。" #: ../../glossary.rst:1009 msgid "Pythonic" msgstr "Pythonic" #: ../../glossary.rst:1011 msgid "" "An idea or piece of code which closely follows the most common idioms of the" " Python language, rather than implementing code using concepts common to " "other languages. For example, a common idiom in Python is to loop over all " "elements of an iterable using a :keyword:`for` statement. Many other " "languages don't have this type of construct, so people unfamiliar with " "Python sometimes use a numerical counter instead::" msgstr "" "他の言語で一般的な考え方で書かれたコードではなく、Python の特に一般的なイディオムに従った考え方やコード片。例えば、Python " "の一般的なイディオムでは :keyword:`for` " "文を使ってイテラブルのすべての要素に渡ってループします。他の多くの言語にはこの仕組みはないので、Python " "に慣れていない人は代わりに数値のカウンターを使うかもしれません::" #: ../../glossary.rst:1021 msgid "As opposed to the cleaner, Pythonic method::" msgstr "これに対し、きれいな Pythonic な方法は::" #: ../../glossary.rst:1025 msgid "qualified name" msgstr "qualified name" #: ../../glossary.rst:1027 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " "top-level functions and classes, the qualified name is the same as the " "object's name::" msgstr "" "(修飾名) モジュールのグローバルスコープから、そのモジュールで定義されたクラス、関数、メソッドへの、 \"パス\" を表すドット名表記です。 " ":pep:`3155` で定義されています。トップレベルの関数やクラスでは、修飾名はオブジェクトの名前と同じです::" #: ../../glossary.rst:1044 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. " "``email.mime.text``::" msgstr "" "モジュールへの参照で使われると、*完全修飾名 (fully qualified name)* はすべての親パッケージを含む全体のドット名表記、例えば " "``email.mime.text`` を意味します::" #: ../../glossary.rst:1051 msgid "reference count" msgstr "reference count" #: ../../glossary.rst:1053 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Reference counting is generally " "not visible to Python code, but it is a key element of the :term:`CPython` " "implementation. The :mod:`sys` module defines a :func:`~sys.getrefcount` " "function that programmers can call to return the reference count for a " "particular object." msgstr "" "(参照カウント) あるオブジェクトに対する参照の数。参照カウントが0になったとき、そのオブジェクトは破棄されます。参照カウントは通常は Python " "のコード上には現れませんが、 :term:`CPython` 実装の重要な要素です。 :mod:`sys` " "モジュールは、プログラマーが任意のオブジェクトの参照カウントを知るための :func:`~sys.getrefcount` 関数を提供しています。" #: ../../glossary.rst:1059 msgid "regular package" msgstr "regular package" #: ../../glossary.rst:1061 msgid "" "A traditional :term:`package`, such as a directory containing an " "``__init__.py`` file." msgstr "伝統的な、 ``__init__.py`` ファイルを含むディレクトリとしての :term:`package`。" #: ../../glossary.rst:1064 msgid "See also :term:`namespace package`." msgstr ":term:`namespace package` を参照してください。" #: ../../glossary.rst:1065 msgid "__slots__" msgstr "__slots__" #: ../../glossary.rst:1067 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " "the technique is somewhat tricky to get right and is best reserved for rare " "cases where there are large numbers of instances in a memory-critical " "application." msgstr "" "クラス内での宣言で、インスタンス属性の領域をあらかじめ定義しておき、インスタンス辞書を排除することで、メモリを節約します。これはよく使われるテクニックですが、正しく扱うには少しトリッキーなので、稀なケース、例えばメモリが死活問題となるアプリケーションでインスタンスが大量に存在する、といったときを除き、使わないのがベストです。" #: ../../glossary.rst:1072 msgid "sequence" msgstr "sequence" #: ../../glossary.rst:1074 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`__getitem__` special method and defines a " ":meth:`__len__` method that returns the length of the sequence. Some built-" "in sequence types are :class:`list`, :class:`str`, :class:`tuple`, and " ":class:`bytes`. Note that :class:`dict` also supports :meth:`__getitem__` " "and :meth:`__len__`, but is considered a mapping rather than a sequence " "because the lookups use arbitrary :term:`immutable` keys rather than " "integers." msgstr "" "(シーケンス) 整数インデクスによる効率的な要素アクセスを :meth:`__getitem__` 特殊メソッドを通じてサポートし、長さを返す " ":meth:`__len__` メソッドを定義した :term:`iterable` です。組み込みシーケンス型には、 :class:`list`, " ":class:`str`, :class:`tuple`, :class:`bytes` などがあります。 :class:`dict` は " ":meth:`__getitem__` と :meth:`__len__` もサポートしますが、検索の際に整数ではなく任意の " ":term:`immutable` なキーを使うため、シーケンスではなくマッピング (mapping) とみなされているので注意してください。" #: ../../glossary.rst:1083 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`__getitem__` and " ":meth:`__len__`, adding :meth:`count`, :meth:`index`, :meth:`__contains__`, " "and :meth:`__reversed__`. Types that implement this expanded interface can " "be registered explicitly using :func:`~abc.ABCMeta.register`." msgstr "" #: ../../glossary.rst:1090 msgid "set comprehension" msgstr "" #: ../../glossary.rst:1092 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " "not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See " ":ref:`comprehensions`." msgstr "" #: ../../glossary.rst:1096 msgid "single dispatch" msgstr "single dispatch" #: ../../glossary.rst:1098 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." msgstr ":term:`generic function` の一種で実装は一つの引数の型により選択されます。" #: ../../glossary.rst:1100 msgid "slice" msgstr "slice" #: ../../glossary.rst:1102 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " "when several are given, such as in ``variable_name[1:3:5]``. The bracket " "(subscript) notation uses :class:`slice` objects internally." msgstr "" "(スライス) 一般に :term:`シーケンス ` の一部を含むオブジェクト。スライスは、添字表記 ``[]`` " "で与えられた複数の数の間にコロンを書くことで作られます。例えば、 ``variable_name[1:3:5]`` です。角括弧 (添字) 記号は " ":class:`slice` オブジェクトを内部で利用しています。" #: ../../glossary.rst:1106 msgid "special method" msgstr "special method" #: ../../glossary.rst:1110 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " "with double underscores. Special methods are documented in " ":ref:`specialnames`." msgstr "" "(特殊メソッド) ある型に特定の操作、例えば加算をするために Python " "から暗黙に呼び出されるメソッド。この種類のメソッドは、メソッド名の最初と最後にアンダースコア 2 つがついています。特殊メソッドについては " ":ref:`specialnames` で解説されています。" #: ../../glossary.rst:1114 msgid "statement" msgstr "statement" #: ../../glossary.rst:1116 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either" " an :term:`expression` or one of several constructs with a keyword, such as " ":keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" "(文) 文はスイート (コードの\"ブロック\") に不可欠な要素です。文は :term:`式 ` " "かキーワードから構成されるもののどちらかです。後者には :keyword:`if`、:keyword:`while`、:keyword:`for` " "があります。" #: ../../glossary.rst:1119 msgid "strong reference" msgstr "" #: ../../glossary.rst:1121 msgid "" "In Python's C API, a strong reference is a reference to an object which " "increments the object's reference count when it is created and decrements " "the object's reference count when it is deleted." msgstr "" #: ../../glossary.rst:1125 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to" " an object. Usually, the :c:func:`Py_DECREF` function must be called on the " "strong reference before exiting the scope of the strong reference, to avoid " "leaking one reference." msgstr "" #: ../../glossary.rst:1130 msgid "See also :term:`borrowed reference`." msgstr "" #: ../../glossary.rst:1131 msgid "text encoding" msgstr "text encoding" #: ../../glossary.rst:1133 msgid "A codec which encodes Unicode strings to bytes." msgstr "ユニコード文字列をエンコードするコーデックです。" #: ../../glossary.rst:1134 msgid "text file" msgstr "text file" #: ../../glossary.rst:1136 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the " ":term:`text encoding` automatically. Examples of text files are files opened" " in text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, " "and instances of :class:`io.StringIO`." msgstr "" "(テキストファイル) :class:`str` オブジェクトを読み書きできる :term:`file object` です。\n" "しばしば、テキストファイルは実際にバイト指向のデータストリームにアクセスし、 :term:`テキストエンコーディング ` を自動的に行います。\n" "テキストファイルの例は、 :data:`sys.stdin`, :data:`sys.stdout`, :class:`io.StringIO` インスタンスなどをテキストモード (``'r'`` or ``'w'``) で開いたファイルです。" #: ../../glossary.rst:1143 msgid "" "See also :term:`binary file` for a file object able to read and write :term" ":`bytes-like objects `." msgstr "" ":term:`bytes-like オブジェクト ` を読み書きできるファイルオブジェクトについては、 " ":term:`バイナリファイル ` も参照してください。" #: ../../glossary.rst:1145 msgid "triple-quoted string" msgstr "triple-quoted string" #: ../../glossary.rst:1147 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " "available with single-quoted strings, they are useful for a number of " "reasons. They allow you to include unescaped single and double quotes " "within a string and they can span multiple lines without the use of the " "continuation character, making them especially useful when writing " "docstrings." msgstr "" "(三重クォート文字列) " "3つの連続したクォート記号(\")かアポストロフィー(')で囲まれた文字列。通常の(一重)クォート文字列に比べて表現できる文字列に違いはありませんが、幾つかの理由で有用です。1つか2つの連続したクォート記号をエスケープ無しに書くことができますし、行継続文字(\\\\)を使わなくても複数行にまたがることができるので、ドキュメンテーション文字列を書く時に特に便利です。" #: ../../glossary.rst:1154 msgid "type" msgstr "type" #: ../../glossary.rst:1156 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its " ":attr:`~instance.__class__` attribute or can be retrieved with " "``type(obj)``." msgstr "" "(型) Python オブジェクトの型はオブジェクトがどのようなものかを決めます。あらゆるオブジェクトは型を持っています。オブジェクトの型は " ":attr:`~instance.__class__` 属性でアクセスしたり、``type(obj)`` で取得したり出来ます。" #: ../../glossary.rst:1160 msgid "type alias" msgstr "type alias" #: ../../glossary.rst:1162 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "(型エイリアス) 型の別名で、型を識別子に代入して作成します。" #: ../../glossary.rst:1164 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "型エイリアスは :term:`型ヒント ` を単純化するのに有用です。例えば::" #: ../../glossary.rst:1171 msgid "could be made more readable like this::" msgstr "これは次のようにより読みやすくできます::" #: ../../glossary.rst:1178 ../../glossary.rst:1192 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "機能の説明がある :mod:`typing` と :pep:`484` を参照してください。" #: ../../glossary.rst:1179 msgid "type hint" msgstr "type hint" #: ../../glossary.rst:1181 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." msgstr "(型ヒント) 変数、クラス属性、関数のパラメータや返り値の期待される型を指定する :term:`annotation` です。" #: ../../glossary.rst:1184 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to static type analysis tools, and aid IDEs with code completion and " "refactoring." msgstr "" "型ヒントは必須ではなく Python では強制ではありませんが、静的型解析ツールにとって有用であり、IDE " "のコード補完とリファクタリングの手助けになります。" #: ../../glossary.rst:1188 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." msgstr "" "グローバル変数、クラス属性、関数で、ローカル変数でないものの型ヒントは :func:`typing.get_type_hints` で取得できます。" #: ../../glossary.rst:1193 msgid "universal newlines" msgstr "universal newlines" #: ../../glossary.rst:1195 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " "Windows convention ``'\\r\\n'``, and the old Macintosh convention ``'\\r'``." " See :pep:`278` and :pep:`3116`, as well as :func:`bytes.splitlines` for an" " additional use." msgstr "" "テキストストリームの解釈法の一つで、以下のすべてを行末と認識します: Unix の行末規定 ``'\\n'``、Windows の規定 " "``'\\r\\n'``、古い Macintosh の規定 ``'\\r'``。利用法について詳しくは、 :pep:`278` と " ":pep:`3116` 、さらに :func:`bytes.splitlines` も参照してください。" #: ../../glossary.rst:1200 msgid "variable annotation" msgstr "variable annotation" #: ../../glossary.rst:1202 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "(変数アノテーション) 変数あるいはクラス属性の :term:`annotation` 。" #: ../../glossary.rst:1204 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "変数あるいはクラス属性に注釈を付けたときは、代入部分は任意です::" #: ../../glossary.rst:1209 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" msgstr "" "変数アノテーションは通常は :term:`型ヒント` のために使われます: 例えば、この変数は :class:`int` " "の値を取ることを期待されています::" #: ../../glossary.rst:1215 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "変数アノテーションの構文については :ref:`annassign` 節で解説しています。" #: ../../glossary.rst:1217 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " "working with annotations." msgstr "" #: ../../glossary.rst:1221 msgid "virtual environment" msgstr "virtual environment" #: ../../glossary.rst:1223 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " "interfering with the behaviour of other Python applications running on the " "same system." msgstr "" "(仮想環境) 協調的に切り離された実行環境です。これにより Python ユーザとアプリケーションは同じシステム上で動いている他の Python " "アプリケーションの挙動に干渉することなく Python パッケージのインストールと更新を行うことができます。" #: ../../glossary.rst:1228 msgid "See also :mod:`venv`." msgstr ":mod:`venv` を参照してください。" #: ../../glossary.rst:1229 msgid "virtual machine" msgstr "virtual machine" #: ../../glossary.rst:1231 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." msgstr "" "(仮想マシン) 完全にソフトウェアにより定義されたコンピュータ。 Python の仮想マシンは、バイトコードコンパイラが出力した " ":term:`バイトコード ` を実行します。" #: ../../glossary.rst:1233 msgid "Zen of Python" msgstr "Zen of Python" #: ../../glossary.rst:1235 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " "\"``import this``\" at the interactive prompt." msgstr "" "(Pythonの悟り) Python を理解し利用する上での導きとなる、Python の設計原則と哲学をリストにしたものです。対話プロンプトで " "\"``import this``\" とするとこのリストを読めます。"