用語集
******

">>>"
   *対話型* シェルにおけるデフォルトの Python プロンプトです。インター
   プリターで対話的に実行されるコード例でよく見られます。

"..."
   次のものが考えられます:

   * 対話型 (*interactive*) シェルにおいて、インデントされたコードブロ
     ック、対応する左右の区切り文字の組 (丸括弧、角括弧、波括弧、三重
     引用符) の内側、デコレーターの後に、コードを入力する際に表示され
     るデフォルトの Python プロンプトです。

   * The three dots form of the Ellipsis object.

abstract base class
   (抽象基底クラス) 抽象基底クラスは *duck-typing* を補完するもので、
   "hasattr()" などの別のテクニックでは不恰好であったり微妙に誤る (例
   えば magic methods の場合) 場合にインターフェースを定義する方法を提
   供します。ABC は仮想 (virtual) サブクラスを導入します。これは親クラ
   スから継承しませんが、それでも "isinstance()" や "issubclass()" に
   認識されます; "abc" モジュールのドキュメントを参照してください。
   Python には、多くの組み込み ABC が同梱されています。その対象は、
   ("collections.abc" モジュールで) データ構造、("numbers" モジュール
   で) 数、("io" モジュールで) ストリーム、("importlib.abc" モジュール
   で) インポートファインダ及びローダーです。 "abc" モジュールを利用し
   て独自の ABC を作成できます。

annotate function
   A function that can be called to retrieve the *annotations* of an
   object. This function is accessible as the "__annotate__" attribute
   of functions, classes, and modules. Annotate functions are a subset
   of *evaluate functions*.

annotation
   (アノテーション) 変数、クラス属性、関数のパラメータや返り値に関係す
   るラベルです。 慣例により *type hint* として使われています。

   Annotations of local variables cannot be accessed at runtime, but
   annotations of global variables, class attributes, and functions
   can be retrieved by calling "annotationlib.get_annotations()" on
   modules, classes, and functions, respectively.

   機能の説明がある *variable annotation*, *function annotation*,
   **PEP 484**, **PEP 526**, **PEP 649** を参照してください。また、ア
   ノテーションを利用するベストプラクティスとして Annotations Best
   Practices も参照してください。

引数 (argument)
   (実引数) 関数を呼び出す際に、 *関数* (または *メソッド*) に渡す値で
   す。実引数には２種類あります:

   * *キーワード引数*: 関数呼び出しの際に引数の前に識別子がついたもの
     (例: "name=") や、 "**" に続けた辞書の中の値として渡された引数。
     例えば、次の "complex()" の呼び出しでは、 "3" と "5" がキーワード
     引数です:

        complex(real=3, imag=5)
        complex(**{'real': 3, 'imag': 5})

   * *位置引数*: キーワード引数以外の引数。位置引数は引数リストの先頭
     に書くことができ、また "*" に続けた *iterable* の要素として渡すこ
     とができます。例えば、次の例では "3" と "5" は両方共位置引数です:

        complex(3, 5)
        complex(*(3, 5))

   実引数は関数の実体において名前付きのローカル変数に割り当てられます
   。割り当てを行う規則については 呼び出し (call) を参照してください。
   シンタックスにおいて実引数を表すためにあらゆる式を使うことが出来ま
   す。評価された値はローカル変数に割り当てられます。

   *仮引数* 、FAQ の 実引数と仮引数の違いは何ですか? 、**PEP 362** を
   参照してください。

asynchronous context manager
   (非同期コンテキストマネージャ) "__aenter__()" と "__aexit__()" メソ
   ッドを定義することで "async with" 文内の環境を管理するオブジェクト
   です。  **PEP 492** で導入されました。

asynchronous generator
   (非同期ジェネレータ) *asynchronous generator iterator* を返す関数で
   す。 "async def" で定義されたコルーチン関数に似ていますが、 "yield"
   式を持つ点で異なります。 "yield" 式は "async for" ループで使用でき
   る値の並びを生成するのに使用されます。

   通常は非同期ジェネレータ関数を指しますが、文脈によっては *非同期ジ
   ェネレータイテレータ* を指す場合があります。 意図された意味が明らか
   でない場合、 明瞭化のために完全な単語を使用します。

   非同期ジェネレータ関数には、 "async for" 文や "async with" 文だけで
   なく "await" 式もあることがあります。

asynchronous generator iterator
   (非同期ジェネレータイテレータ) *asynchronous generator* 関数で生成
   されるオブジェクトです。

   これは *asynchronous iterator* で、 "__anext__()" メソッドを使って
   呼ばれると awaitable オブジェクトを返します。  この awaitable オブ
   ジェクトは、次の "yield" 式まで非同期ジェネレータ関数の本体を実行し
   ます。

   各 "yield" では一時的に処理を中断し、その実行状態 (ローカル変数や保
   留中の try 文を含む) を記憶します。  *非同期ジェネレータイテレータ*
   が "__anext__()" で返された他の awaitable で実際に再開する時には、
   その中断箇所が選ばれます。  **PEP 492** および **PEP 525** を参照し
   てください。

asynchronous iterable
   (非同期イテラブル) "async for" 文の中で使用できるオブジェクトです。
   自身の "__aiter__()" メソッドから *asynchronous iterator* を返さな
   ければなりません。  **PEP 492** で導入されました。

asynchronous iterator
   (非同期イテレータ) "__aiter__()" と "__anext__()" メソッドを実装し
   たオブジェクトです。  "__anext__()" は *awaitable* オブジェクトを返
   さなければなりません。  "async for" は "StopAsyncIteration" 例外を
   送出するまで、非同期イテレータの "__anext__()" メソッドが返す
   awaitable を解決します。  **PEP 492** で導入されました。

atomic operation
   An operation that appears to execute as a single, indivisible step:
   no other thread can observe it half-done, and its effects become
   visible all at once.  Python does not guarantee that high-level
   statements are atomic (for example, "x += 1" performs multiple
   bytecode operations and is not atomic).  Atomicity is only
   guaranteed where explicitly documented.  See also *race condition*
   and *data race*.

attached thread state
   A *thread state* that is active for the current OS thread.

   When a *thread state* is attached, the OS thread has access to the
   full Python C API and can safely invoke the bytecode interpreter.

   Unless a function explicitly notes otherwise, attempting to call
   the C API without an attached thread state will result in a fatal
   error or undefined behavior.  A thread state can be attached and
   detached explicitly by the user through the C API, or implicitly by
   the runtime, including during blocking C calls and by the bytecode
   interpreter in between calls.

   On most builds of Python, having an attached thread state implies
   that the caller holds the *GIL* for the current interpreter, so
   only one OS thread can have an attached thread state at a given
   moment. In *free-threaded* builds of Python, threads can
   concurrently hold an attached thread state, allowing for true
   parallelism of the bytecode interpreter.

属性
   (属性) オブジェクトに関連付けられ、ドット表記式によって名前で通常参
   照される値です。例えば、オブジェクト *o* が属性 *a* を持っていると
   き、その属性は *o.a* で参照されます。

   オブジェクトには、 Names (identifiers and keywords) で定義される識
   別子ではない名前の属性を与えることができます。たとえば "setattr()"
   を使い、オブジェクトがそれを許可している場合に行えます。このような
   属性はドット表記式ではアクセスできず、代わりに "getattr()" を使って
   取る必要があります。

awaitable
   (待機可能) "await" 式で使用することが出来るオブジェクトです。
   *coroutine* か、 "__await__()" メソッドがあるオブジェクトです。
   **PEP 492** を参照してください。

BDFL
   慈悲深き終身独裁者 (Benevolent Dictator For Life) の略です。Python
   の作者、Guido van Rossum のことです。

binary file
   (バイナリファイル) *bytes-like オブジェクト* の読み込みおよび書き込
   みができる *ファイルオブジェクト* です。 バイナリファイルの例は、バ
   イナリモード ("'rb'", "'wb'" or "'rb+'") で開かれたファイル、
   "sys.stdin.buffer"、"sys.stdout.buffer"、 "io.BytesIO" や
   "gzip.GzipFile". のインスタンスです。

   "str" オブジェクトの読み書きができるファイルオブジェクトについては
   、 *text file* も参照してください。

borrowed reference
   In Python's C API, a borrowed reference is a reference to an
   object, where the code using the object does not own the reference.
   It becomes a dangling pointer if the object is destroyed. For
   example, a garbage collection can remove the last *strong
   reference* to the object and so destroy it.

   Calling "Py_INCREF()" on the *borrowed reference* is recommended to
   convert it to a *strong reference* in-place, except when the object
   cannot be destroyed before the last usage of the borrowed
   reference. The "Py_NewRef()" function can be used to create a new
   *strong reference*.

bytes-like object
   バッファプロトコル (buffer Protocol) をサポートしていて、 C 言語の
   意味で *連続した* バッファーを提供可能なオブジェクト。 "bytes",
   "bytearray", "array.array" や、多くの一般的な "memoryview" オブジェ
   クトがこれに当たります。 bytes-like オブジェクトは、データ圧縮、バ
   イナリファイルへの保存、ソケットを経由した送信など、バイナリデータ
   を要求するいろいろな操作に利用することができます。

   幾つかの操作ではバイナリデータを変更する必要があります。 その操作の
   ドキュメントではよく "読み書き可能な bytes-like オブジェクト" に言
   及しています。 変更可能なバッファーオブジェクトには、 "bytearray"
   と "bytearray" の "memoryview" などが含まれます。 また、他の幾つか
   の操作では不変なオブジェクト内のバイナリデータ ("読み出し専用の
   bytes-like オブジェクト") を必要します。それには "bytes" と "bytes"
   の "memoryview" オブジェクトが含まれます。

bytecode
   (バイトコード) Python のソースコードは、 Python プログラムの
   CPython インタプリタの内部表現であるバイトコードへとコンパイルされ
   ます。 バイトコードは ".pyc" ファイルにキャッシュされ、同じファイル
   が二度目に実行されるときはより高速になります (ソースコードからバイ
   トコードへの再度のコンパイルは回避されます)。 この "中間言語
   (intermediate language)" は、各々のバイトコードに対応する機械語を実
   行する *仮想マシン* で動作するといえます。 重要な注意として、バイト
   コードは異なる Python 仮想マシン間で動作することや、Python リリース
   間で安定であることは期待されていません。

   バイトコードの命令一覧は dis モジュール にあります。

callable
   A callable is an object that can be called, possibly with a set of
   arguments (see *argument*), with the following syntax:

      callable(argument1, argument2, argumentN)

   A *function*, and by extension a *method*, is a callable. An
   instance of a class that implements the "__call__()" method is also
   a callable.

callback
   (コールバック) 将来のある時点で実行されるために引数として渡される関
   数

クラス
   (クラス) ユーザー定義オブジェクトを作成するためのテンプレートです。
   クラス定義は普通、そのクラスのインスタンス上の操作をするメソッドの
   定義を含みます。

class variable
   (クラス変数) クラス上に定義され、クラスレベルで (つまり、クラスのイ
   ンスタンス上ではなしに) 変更されることを目的としている変数です。

closure variable
   A *free variable* referenced from a *nested scope* that is defined
   in an outer scope rather than being resolved at runtime from the
   globals or builtin namespaces. May be explicitly defined with the
   "nonlocal" keyword to allow write access, or implicitly defined if
   the variable is only being read.

   For example, in the "inner" function in the following code, both
   "x" and "print" are *free variables*, but only "x" is a *closure
   variable*:

      def outer():
          x = 0
          def inner():
              nonlocal x
              x += 1
              print(x)
          return inner

   Due to the "codeobject.co_freevars" attribute (which, despite its
   name, only includes the names of closure variables rather than
   listing all referenced free variables), the more general *free
   variable* term is sometimes used even when the intended meaning is
   to refer specifically to closure variables.

complex number
   (複素数) よく知られている実数系を拡張したもので、すべての数は実部と
   虚部の和として表されます。虚数は虚数単位 ("-1" の平方根) に実数を掛
   けたもので、一般に数学では "i" と書かれ、工学では "j" と書かれます
   。Python は複素数に組み込みで対応し、後者の表記を取っています。虚部
   は末尾に "j" をつけて書きます。例えば "3+1j" です。 "math" モジュー
   ルの複素数版を利用するには、 "cmath" を使います。複素数の使用はかな
   り高度な数学の機能です。必要性を感じなければ、ほぼ間違いなく無視し
   てしまってよいでしょう。

concurrency
   The ability of a computer program to perform multiple tasks at the
   same time.  Python provides libraries for writing programs that
   make use of different forms of concurrency.  "asyncio" is a library
   for dealing with asynchronous tasks and coroutines.  "threading"
   provides access to operating system threads and "multiprocessing"
   to operating system processes. Multi-core processors can execute
   threads and processes on different CPU cores at the same time (see
   *parallelism*).

concurrent modification
   When multiple threads modify shared data at the same time.
   Concurrent modification without proper synchronization can cause
   *race conditions*, and might also trigger a *data race*, data
   corruption, or both.

context
   This term has different meanings depending on where and how it is
   used. Some common meanings:

   * The temporary state or environment established by a *context
     manager* via a "with" statement.

   * The collection of key­value bindings associated with a particular
     "contextvars.Context" object and accessed via "ContextVar"
     objects.  Also see *context variable*.

   * A "contextvars.Context" object.  Also see *current context*.

コンテキスト管理プロトコル
   The "__enter__()" and "__exit__()" methods called by the "with"
   statement.  See **PEP 343**.

context manager
   An object which implements the *context management protocol* and
   controls the environment seen in a "with" statement.  See **PEP
   343**.

context variable
   A variable whose value depends on which context is the *current
   context*.  Values are accessed via "contextvars.ContextVar"
   objects.  Context variables are primarily used to isolate state
   between concurrent asynchronous tasks.

contiguous
   (隣接、連続) バッファが厳密に *C-連続* または *Fortran 連続* である
   場合に、そのバッファは連続しているとみなせます。 ゼロ次元バッファは
   C 連続であり Fortran 連続です。 一次元の配列では、その要素は必ずメ
   モリ上で隣接するように配置され、添字がゼロから始まり増えていく順序
   で並びます。 多次元の C-連続な配列では、メモリアドレス順に要素を巡
   る際には最後の添え字が最初に変わるのに対し、 Fortran 連続な配列では
   最初の添え字が最初に動きます。

コルーチン
   (コルーチン) コルーチンはサブルーチンのより一般的な形式です。 サブ
   ルーチンには決められた地点から入り、別の決められた地点から出ます。
   コルーチンには多くの様々な地点から入る、出る、再開することができま
   す。 コルーチンは "async def" 文で実装できます。 **PEP 492** を参照
   してください。

coroutine function
   (コルーチン関数) *coroutine* オブジェクトを返す関数です。 コルーチ
   ン関数は "async def" 文で実装され、"await"、"async for"、 および
   "async with" キーワードを持つことが出来ます。 これらは **PEP 492**
   で導入されました。

CPython
   python.org で配布されている、Python プログラミング言語の標準的な実
   装です。"CPython" という単語は、この実装を Jython や IronPython と
   いった他の実装と区別する必要が有る場合に利用されます。

current context
   The *context* ("contextvars.Context" object) that is currently used
   by "ContextVar" objects to access (get or set) the values of
   *context variables*.  Each thread has its own current context.
   Frameworks for executing asynchronous tasks (see "asyncio")
   associate each task with a context which becomes the current
   context whenever the task starts or resumes execution.

cyclic isolate
   A subgroup of one or more objects that reference each other in a
   reference cycle, but are not referenced by objects outside the
   group.  The goal of the *cyclic garbage collector* is to identify
   these groups and break the reference cycles so that the memory can
   be reclaimed.

data race
   A situation where multiple threads access the same memory location
   concurrently, at least one of the accesses is a write, and the
   threads do not use any synchronization to control their access.
   Data races lead to *non-deterministic* behavior and can cause data
   corruption. Proper use of *locks* and other *synchronization
   primitives* prevents data races.  Note that data races can only
   happen in native code, but that *native code* might be exposed in a
   Python API.  See also *race condition* and *thread-safe*.

deadlock
   A situation in which two or more tasks (threads, processes, or
   coroutines) wait indefinitely for each other to release resources
   or complete actions, preventing any from making progress.  For
   example, if thread A holds lock 1 and waits for lock 2, while
   thread B holds lock 2 and waits for lock 1, both threads will wait
   indefinitely.  In Python this often arises from acquiring multiple
   locks in conflicting orders or from circular join/await
   dependencies.  Deadlocks can be avoided by always acquiring
   multiple *locks* in a consistent order.  See also *lock* and
   *reentrant*.

decorator
   (デコレータ) 別の関数を返す関数で、通常、 "@wrapper" 構文で関数変換
   として適用されます。デコレータの一般的な利用例は、 "classmethod()"
   と "staticmethod()" です。

   デコレータの文法はシンタックスシュガーです。次の2つの関数定義は意味
   的に同じものです:

      def f(arg):
          ...
      f = staticmethod(f)

      @staticmethod
      def f(arg):
          ...

   同じ概念がクラスにも存在しますが、あまり使われません。デコレータに
   ついて詳しくは、 関数定義 および クラス定義 のドキュメントを参照し
   てください。

descriptor
   Any object which defines the methods "__get__()", "__set__()", or
   "__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.

   デスクリプタのメソッドに関しての詳細は、 デスクリプタ (descriptor)
   の実装 や Descriptor How To Guide を参照してください。

dictionary
   An associative array, where arbitrary keys are mapped to values.
   The keys can be any object with "__hash__()" and "__eq__()"
   methods. Called a hash in Perl.

dictionary comprehension
   (辞書内包表記) iterable 内の全てあるいは一部の要素を処理して、その
   結果からなる辞書を返すコンパクトな書き方です。 "results = {n: n **
   2 for n in range(10)}" とすると、キー "n" を値 "n ** 2" に対応付け
   る辞書を生成します。 リスト、集合、辞書の表示 を参照してください。

dictionary view
   (辞書ビュー) "dict.keys()"、"dict.values()"、"dict.items()" が返す
   オブジェクトです。 辞書の項目の動的なビューを提供します。 すなわち
   、辞書が変更されるとビューはそれを反映します。 辞書ビューを強制的に
   完全なリストにするには "list(dictview)" を使用してください。 辞書ビ
   ューオブジェクト を参照してください。

docstring
   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 "__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.

duck-typing
   あるオブジェクトが正しいインターフェースを持っているかを決定するの
   にオブジェクトの型を見ないプログラミングスタイルです。代わりに、単
   純にオブジェクトのメソッドや属性が呼ばれたり使われたりします。（「
   アヒルのように見えて、アヒルのように鳴けば、それはアヒルである。」
   ）インターフェースを型より重視することで、上手くデザインされたコー
   ドは、ポリモーフィックな代替を許して柔軟性を向上させます。ダックタ
   イピングは "type()" や "isinstance()" による判定を避けます。 (ただ
   し、ダックタイピングを *抽象基底クラス* で補完することもできます。)
   その代わり、典型的に "hasattr()" 判定や *EAFP* プログラミングを利用
   します。

dunder
   An informal short-hand for "double underscore", used when talking
   about a *special method*. For example, "__init__" is often
   pronounced "dunder init".

EAFP
   「認可をとるより許しを請う方が容易  (easier to ask for forgiveness
   than permission、マーフィーの法則)」の略です。この Python で広く使
   われているコーディングスタイルでは、通常は有効なキーや属性が存在す
   るものと仮定し、その仮定が誤っていた場合に例外を捕捉します。この簡
   潔で手早く書けるコーディングスタイルには、 "try" 文および "except"
   文がたくさんあるのが特徴です。このテクニックは、C のような言語でよ
   く使われている *LBYL* スタイルと対照的なものです。

evaluate function
   A function that can be called to evaluate a lazily evaluated
   attribute of an object, such as the value of type aliases created
   with the "type" statement.

expression
   (式) 何かの値と評価される、一まとまりの構文 (a piece of syntax) で
   す。言い換えると、式とはリテラル、名前、属性アクセス、演算子や関数
   呼び出しなど、値を返す式の要素の積み重ねです。他の多くの言語と違い
   、Python では言語の全ての構成要素が式というわけではありません。
   "while" のように、式としては使えない *文* もあります。代入も式では
   なく文です。

extension module
   (拡張モジュール) C や C++ で書かれたモジュールで、Python の C API
   を利用して Python コアやユーザーコードとやりとりします。

f-string
f-strings
   String literals prefixed with "f" or "F" are commonly called
   "f-strings" which is short for formatted string literals.  See also
   **PEP 498**.

file object
   An object exposing a file-oriented API (with methods such as
   "read()" or "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 *file-like objects* or
   *streams*.

   ファイルオブジェクトには実際には 3 種類あります: 生の *バイナリーフ
   ァイル*、バッファされた *バイナリーファイル*、そして *テキストファ
   イル* です。インターフェイスは "io" モジュールで定義されています。
   ファイルオブジェクトを作る標準的な方法は "open()" 関数を使うことで
   す。

file-like object
   *file object* と同義です。

filesystem encoding and error handler
   Encoding and error handler used by Python to decode bytes from the
   operating system and encode Unicode to the operating system.

   ファイルシステムのエンコーディングでは、すべてが 128 バイト以下に正
   常にデコードされることが保証されなくてはなりません。ファイルシステ
   ムのエンコーディングでこれが保証されなかった場合は、API 関数が
   "UnicodeError" を送出することがあります。

   The "sys.getfilesystemencoding()" and
   "sys.getfilesystemencodeerrors()" functions can be used to get the
   filesystem encoding and error handler.

   term:*ファイルシステムのエンコーディングとエラーハンドラ
   <filesystem encoding and error handler>* は、Pythonの開始時に
   :c:func:*PyConfig_Read* 関数により設定されます。 "PyConfig" のメン
   バー "filesystem_encoding" と "filesystem_errors" を参照してくださ
   い。

   See also the *locale encoding*.

finder
   (ファインダ) インポートされているモジュールの *loader* の発見を試行
   するオブジェクトです。

   There are two types of finder: *meta path finders* for use with
   "sys.meta_path", and *path entry finders* for use with
   "sys.path_hooks".

   See ファインダーとローダー and "importlib" for much more detail.

floor division
   (切り捨て除算) 一番近い整数に切り捨てる数学的除算。 切り捨て除算演
   算子は "//" です。 例えば、 "11 // 4" は "2" になり、それとは対称に
   浮動小数点数の真の除算では "2.75" が 返ってきます。 "(-11) // 4" は
   "-2.75" を *小さい方に* 丸める (訳注: 負の無限大への丸めを行う) の
   で "-3" になることに注意してください。 **PEP 238** を参照してくださ
   い。

free threading
   A threading model where multiple threads can run Python bytecode
   simultaneously within the same interpreter.  This is in contrast to
   the *global interpreter lock* which allows only one thread to
   execute Python bytecode at a time.  See **PEP 703**.

free variable
   Formally, as defined in the language execution model, a free
   variable is any variable used in a namespace which is not a local
   variable in that namespace. See *closure variable* for an example.
   Pragmatically, due to the name of the "codeobject.co_freevars"
   attribute, the term is also sometimes used as a synonym for
   *closure variable*.

関数
   (関数) 呼び出し側に値を返す一連の文のことです。関数には0以上の *実
   引数* を渡すことが出来ます。実体の実行時に引数を使用することが出来
   ます。 *仮引数*、*メソッド*、関数定義 を参照してください。

function annotation
   (関数アノテーション) 関数のパラメータや返り値の *annotation* です。

   関数アノテーションは、通常は *型ヒント* のために使われます: 例えば
   、この関数は 2 つの "int" 型の引数を取ると期待され、また "int" 型の
   返り値を持つと期待されています。

      def sum_two_numbers(a: int, b: int) -> int:
         return a + b

   関数アノテーションの文法は 関数定義 の節で解説されています。

   機能の説明がある *variable annotation*, **PEP 484**,を参照してくだ
   さい。また、アノテーションを利用するベストプラクティスとして
   Annotations Best Practices も参照してください。

__future__
   "from __future__ import <feature>" という future 文 は、コンパイラ
   ーに将来の Python リリースで標準となる構文や意味を使用して現在のモ
   ジュールをコンパイルするよう指示します。 "__future__" モジュールで
   は、 *feature* のとりうる値をドキュメント化しています。このモジュー
   ルをインポートし、その変数を評価することで、新機能が最初に言語に追
   加されたのはいつかや、いつデフォルトになるか (またはなったか) を見
   ることができます:

      >>> import __future__
      >>> __future__.division
      _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)

garbage collection
   (ガベージコレクション) これ以降使われることのないメモリを解放する処
   理です。 Pythonは、参照カウントと、循環参照を検出し破壊する循環ガベ
   ージコレクタを使ってガベージコレクションを行います。 ガベージコレク
   タは "gc" モジュールを使って操作できます。

ジェネレータ
   (ジェネレータ) *generator iterator* を返す関数です。 通常の関数に似
   ていますが、 "yield" 式を持つ点で異なります。 "yield" 式は、 for ル
   ープで使用できたり、"next()" 関数で値を 1 つずつ取り出したりできる
   、値の並びを生成するのに使用されます。

   通常はジェネレータ関数を指しますが、文脈によっては *ジェネレータイ
   テレータ* を指す場合があります。 意図された意味が明らかでない場合、
   明瞭化のために完全な単語を使用します。

generator iterator
   (ジェネレータイテレータ) *generator* 関数で生成されるオブジェクトで
   す。

   Each "yield" temporarily suspends processing, remembering the
   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).

generator expression
   (ジェネレータ式) *iterator* を返す *式*  です。 普通の式に、ループ
   変数を定義する "for" 節、範囲、そして省略可能な "if" 節がつづいてい
   るように見えます。 こうして構成された式は、外側の関数に向けて値を生
   成します:

      >>> sum(i*i for i in range(10))         # sum of squares 0, 1, 4, ... 81
      285

generic function
   (ジェネリック関数) 異なる型に対し同じ操作をする関数群から構成される
   関数です。呼び出し時にどの実装を用いるかはディスパッチアルゴリズム
   により決定されます。

   *single dispatch*、"functools.singledispatch()" デコレータ、**PEP
   443** を参照してください。

generic type
   A *type* that can be parameterized; typically a container class
   such as "list" or "dict". Used for *type hints* and *annotations*.

   For more details, see generic alias types, **PEP 483**, **PEP
   484**, **PEP 585**, and the "typing" module.

GIL
   *global interpreter lock* を参照してください。

global interpreter lock
   (グローバルインタプリタロック) *CPython* インタプリタが利用している
   、一度に Python の *バイトコード* を実行するスレッドは一つだけであ
   ることを保証する仕組みです。これにより ("dict" などの重要な組み込み
   型を含む) オブジェクトモデルが同時アクセスに対して暗黙的に安全にな
   るので、 CPython の実装がシンプルになります。インタプリタ全体をロッ
   クすることで、マルチプロセッサマシンが生じる並列化のコストと引き換
   えに、インタプリタを簡単にマルチスレッド化できるようになります。

   ただし、標準あるいは外部のいくつかの拡張モジュールは、圧縮やハッシ
   ュ計算などの計算の重い処理をするときに GIL を解除するように設計され
   ています。また、I/O 処理をする場合 GIL は常に解除されます。

   As of Python 3.13, the GIL can be disabled using the "--disable-
   gil" build configuration. After building Python with this option,
   code must be run with "-X gil=0" or after setting the
   "PYTHON_GIL=0" environment variable. This feature enables improved
   performance for multi-threaded applications and makes it easier to
   use multi-core CPUs efficiently. For more details, see **PEP 703**.

   In prior versions of Python's C API, a function might declare that
   it requires the GIL to be held in order to use it. This refers to
   having an *attached thread state*.

global state
   Data that is accessible throughout a program, such as module-level
   variables, class variables, or C static variables in *extension
   modules*.  In multi-threaded programs, global state shared between
   threads typically requires synchronization to avoid *race
   conditions* and *data races*.

hash-based pyc
   (ハッシュベース pyc ファイル) 正当性を判別するために、対応するソー
   スファイルの最終更新時刻ではなくハッシュ値を使用するバイトコードの
   キャッシュファイルです。キャッシュされたバイトコードの無効化 を参照
   してください。

hashable
   An object is *hashable* if it has a hash value which never changes
   during its lifetime (it needs a "__hash__()" method), and can be
   compared to other objects (it needs an "__eq__()" method). Hashable
   objects which compare equal must have the same hash value.

   ハッシュ可能なオブジェクトは辞書のキーや集合のメンバーとして使えま
   す。辞書や集合のデータ構造は内部でハッシュ値を使っているからです。

   Python のイミュータブルな組み込みオブジェクトは、ほとんどがハッシュ
   可能です。(リストや辞書のような) ミュータブルなコンテナはハッシュ不
   可能です。(タプルや frozenset のような) イミュータブルなコンテナは
   、要素がハッシュ可能であるときのみハッシュ可能です。 ユーザー定義の
   クラスのインスタンスであるようなオブジェクトはデフォルトでハッシュ
   可能です。 それらは全て (自身を除いて) 比較結果は非等価であり、ハッ
   シュ値は "id()" より得られます。

IDLE
   Python の統合開発環境 (Integrated DeveLopment Environment)及び学習
   環境 (Learning Environment) です。IDLE --- Python のエディタとシェ
   ル は Python の標準的な配布に同梱されている基本的な機能のエディタと
   インタプリタ環境です。

永続オブジェクト (immortal)
   *Immortal objects* are a CPython implementation detail introduced
   in **PEP 683**.

   If an object is immortal, its *reference count* is never modified,
   and therefore it is never deallocated while the interpreter is
   running. For example, "True" and "None" are immortal in CPython.

   Immortal objects can be identified via "sys._is_immortal()", or via
   "PyUnstable_IsImmortal()" in the C API.

immutable
   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.  Immutable objects
   are inherently *thread-safe* because their state cannot be modified
   after creation, eliminating concerns about improperly synchronized
   *concurrent modification*.

import path
   *path based finder* が import するモジュールを検索する場所 (または
   *path entry*) のリスト。 import 中、このリストは通常 "sys.path" か
   ら来ますが、サブパッケージの場合は親パッケージの "__path__" 属性か
   らも来ます。

importing
   あるモジュールの Python コードが別のモジュールの Python コードで使
   えるようにする処理です。

importer
   モジュールを探してロードするオブジェクト。 *finder* と *loader* の
   どちらでもあるオブジェクト。

interactive
   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)"). For more on interactive
   mode, see 対話モード.

interpreted
   Python はインタプリタ形式の言語であり、コンパイラ言語の対極に位置し
   ます。 (バイトコードコンパイラがあるために、この区別は曖昧ですが。)
   ここでのインタプリタ言語とは、ソースコードのファイルを、まず実行可
   能形式にしてから実行させるといった操作なしに、直接実行できることを
   意味します。インタプリタ形式の言語は通常、コンパイラ形式の言語より
   も開発／デバッグのサイクルは短いものの、プログラムの実行は一般に遅
   いです。 *対話的* も参照してください。

interpreter shutdown
   Python インタープリターはシャットダウンを要請された時に、モジュール
   やすべてのクリティカルな内部構造をなどの、すべての確保したリソース
   を段階的に開放する、特別なフェーズに入ります。 このフェーズは *ガベ
   ージコレクタ* を複数回呼び出します。 これによりユーザー定義のデスト
   ラクターや weakref コールバックが呼び出されることがあります。 シャ
   ットダウンフェーズ中に実行されるコードは、それが依存するリソースが
   すでに機能しない(よくある例はライブラリーモジュールや warning 機構
   です) ために様々な例外に直面します。

   インタープリタがシャットダウンする主な理由は "__main__" モジュール
   や実行されていたスクリプトの実行が終了したことです。

iterable
   An object capable of returning its members one at a time. Examples
   of iterables include all sequence types (such as "list", "str", and
   "tuple") and some non-sequence types like "dict", *file objects*,
   and objects of any classes you define with an "__iter__()" method
   or with a "__getitem__()" method that implements *sequence*
   semantics.

   反復可能オブジェクトは "for" ループ内やその他多くのシーケンス (訳注
   : ここでのシーケンスとは、シーケンス型ではなくただの列という意味)が
   必要となる状況 ("zip()", "map()", ...) で利用できます。 反復可能オ
   ブジェクトを組み込み関数 "iter()" の引数として渡すと、 オブジェクト
   に対するイテレータを返します。 このイテレータは一連の値を引き渡す際
   に便利です。 通常は反復可能オブジェクトを使う際には、 "iter()" を呼
   んだりイテレータオブジェクトを自分で操作する必要はありません。
   "for" 文ではこの操作を自動的に行い、一時的な無名の変数を作成してル
   ープを回している間イテレータを保持します。 *イテレータ* 、 *シーケ
   ンス* 、 *ジェネレータ* も参照してください。

iterator
   データの流れを表現するオブジェクトです。イテレータの "__next__()"
   メソッドを繰り返し呼び出す (または組み込み関数 "next()" に渡す) と
   、流れの中の要素を一つずつ返します。データがなくなると、代わりに
   "StopIteration" 例外を送出します。その時点で、イテレータオブジェク
   トは尽きており、それ以降は "__next__()" を何度呼んでも
   "StopIteration" を送出します。イテレータは、そのイテレータオブジェ
   クト自体を返す "__iter__()" メソッドを実装しなければならないので、
   イテレータは他の iterable を受理するほとんどの場所で利用できます。
   はっきりとした例外は複数の反復を行うようなコードです。 ("list" のよ
   うな) コンテナオブジェクトは、自身を "iter()" 関数にオブジェクトに
   渡したり "for" ループ内で使うたびに、新たな未使用のイテレータを生成
   します。これをイテレータで行おうとすると、前回のイテレーションで使
   用済みの同じイテレータオブジェクトを単純に返すため、空のコンテナの
   ようになってしまいます。

   詳細な情報は イテレータ型 にあります。

   **CPython 実装の詳細:** CPython does not consistently apply the
   requirement that an iterator define "__iter__()". And also please
   note that *free-threaded* CPython does not guarantee *thread-safe*
   behavior of iterator operations.

key function
   (キー関数) キー関数、あるいは照合関数とは、ソートや順序比較のための
   値を返す呼び出し可能オブジェクト(callable)です。例えば、
   "locale.strxfrm()" をキー関数に使えば、ロケール依存のソートの慣習に
   のっとったソートキーを返します。

   Python の多くのツールはキー関数を受け取り要素の並び順やグループ化を
   管理します。 "min()", "max()", "sorted()", "list.sort()",
   "heapq.merge()", "heapq.nsmallest()", "heapq.nlargest()",
   "itertools.groupby()" 等があります。

   There are several ways to create a key function.  For example. the
   "str.casefold()" method can serve as a key function for case
   insensitive sorts.  Alternatively, a key function can be built from
   a "lambda" expression such as "lambda r: (r[0], r[2])".  Also,
   "operator.attrgetter()", "operator.itemgetter()", and
   "operator.methodcaller()" are three key function constructors.  See
   the Sorting HOW TO for examples of how to create and use key
   functions.

keyword argument
   *実引数* を参照してください。

lambda
   (ラムダ) 無名のインライン関数で、関数が呼び出されたときに評価される
   1 つの *式* を含みます。ラムダ関数を作る構文は "lambda
   [parameters]: expression" です。

LBYL
   「ころばぬ先の杖 (look before you leap)」 の略です。このコーディン
   グスタイルでは、呼び出しや検索を行う前に、明示的に前提条件 (pre-
   condition) 判定を行います。 *EAFP* アプローチと対照的で、 "if" 文が
   たくさん使われるのが特徴的です。

   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.  See also
   *thread-safe*.

lexical analyzer
   Formal name for the *tokenizer*; see *token*.

list
   A built-in Python *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).

list comprehension
   (リスト内包表記) シーケンス中の全てあるいは一部の要素を処理して、そ
   の結果からなるリストを返す、コンパクトな方法です。 "result =
   ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]" とすると、
   0 から 255 までの偶数を 16進数表記 (0x..) した文字列からなるリスト
   を生成します。 "if" 節はオプションです。 "if" 節がない場合、
   "range(256)" の全ての要素が処理されます。

lock
   A *synchronization primitive* that allows only one thread at a time
   to access a shared resource.  A thread must acquire a lock before
   accessing the protected resource and release it afterward.  If a
   thread attempts to acquire a lock that is already held by another
   thread, it will block until the lock becomes available.  Python's
   "threading" module provides "Lock" (a basic lock) and "RLock" (a
   *reentrant* lock).  Locks are used to prevent *race conditions* and
   ensure *thread-safe* access to shared data.  Alternative design
   patterns to locks exist such as queues, producer/consumer patterns,
   and thread-local state. See also *deadlock*, and *reentrant*.

loader
   An object that loads a module. It must define the "exec_module()"
   and "create_module()" methods to implement the "Loader" interface.
   A loader is typically returned by a *finder*. See also:

   * ファインダーとローダー

   * "importlib.abc.Loader"

   * **PEP 302**

ロケールエンコーディング
   On Unix, it is the encoding of the LC_CTYPE locale. It can be set
   with "locale.setlocale(locale.LC_CTYPE, new_locale)".

   On Windows, it is the ANSI code page (ex: ""cp1252"").

   On Android and VxWorks, Python uses ""utf-8"" as the locale
   encoding.

   "locale.getencoding()" can be used to get the locale encoding.

   See also the *filesystem encoding and error handler*.

magic method
   *special method* のくだけた同義語です。

mapping
   (マッピング) 任意のキー探索をサポートしていて、
   "collections.abc.Mapping" か "collections.abc.MutableMapping" の 抽
   象基底クラス で指定されたメソッドを実装しているコンテナオブジェクト
   です。例えば、 "dict", "collections.defaultdict",
   "collections.OrderedDict", "collections.Counter" などです。

meta path finder
   "sys.meta_path" を検索して得られた *finder*. meta path finder は
   *path entry finder* と関係はありますが、別物です。

   meta path finder が実装するメソッドについては
   "importlib.abc.MetaPathFinder" を参照してください。

metaclass
   (メタクラス) クラスのクラスです。クラス定義は、クラス名、クラスの辞
   書と、基底クラスのリストを作ります。メタクラスは、それら 3 つを引数
   として受け取り、クラスを作る責任を負います。ほとんどのオブジェクト
   指向言語は(訳注:メタクラスの)デフォルトの実装を提供しています。
   Python が特別なのはカスタムのメタクラスを作成できる点です。ほとんど
   のユーザーに取って、メタクラスは全く必要のないものです。しかし、一
   部の場面では、メタクラスは強力でエレガントな方法を提供します。たと
   えば属性アクセスのログを取ったり、スレッドセーフ性を追加したり、オ
   ブジェクトの生成を追跡したり、シングルトンを実装するなど、多くの場
   面で利用されます。

   詳細は メタクラス を参照してください。

メソッド
   (メソッド) クラス本体の中で定義された関数。そのクラスのインスタンス
   の属性として呼び出された場合、メソッドはインスタンスオブジェクトを
   第一 *引数* として受け取ります (この第一引数は通常 "self" と呼ばれ
   ます)。 *関数* と *ネストされたスコープ* も参照してください。

method resolution order
   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.

module
   (モジュール) Python コードの組織単位としてはたらくオブジェクトです
   。モジュールは任意の Python オブジェクトを含む名前空間を持ちます。
   モジュールは *importing* の処理によって Python に読み込まれます。

   *パッケージ* を参照してください。

module spec
   モジュールをロードするのに使われるインポート関連の情報を含む名前空
   間です。 "importlib.machinery.ModuleSpec" のインスタンスです。

   See also Module specs.

MRO
   *method resolution order* を参照してください。

mutable
   An *object* with state that is allowed to change during the course
   of the program.  In multi-threaded programs, mutable objects that
   are shared between threads require careful synchronization to avoid
   *race conditions*.  See also *immutable*, *thread-safe*, and
   *concurrent modification*.

named tuple
   "名前付きタプル" という用語は、タプルを継承していて、インデックスが
   付く要素に対し属性を使ってのアクセスもできる任意の型やクラスに応用
   されています。 その型やクラスは他の機能も持っていることもあります。

   "time.localtime()" や "os.stat()" の返り値を含むいくつかの組み込み
   型は名前付きタプルです。 他の例は "sys.float_info" です:

      >>> sys.float_info[1]                   # indexed access
      1024
      >>> sys.float_info.max_exp              # named field access
      1024
      >>> isinstance(sys.float_info, tuple)   # kind of tuple
      True

   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 "tuple" and that defines named
   fields.  Such a class can be written by hand, or it can be created
   by inheriting "typing.NamedTuple", or with the factory function
   "collections.namedtuple()".  The latter techniques also add some
   extra methods that may not be found in hand-written or built-in
   named tuples.

namespace
   (名前空間) 変数が格納される場所です。名前空間は辞書として実装されま
   す。名前空間にはオブジェクトの (メソッドの) 入れ子になったものだけ
   でなく、局所的なもの、大域的なもの、そして組み込みのものがあります
   。名前空間は名前の衝突を防ぐことによってモジュール性をサポートする
   。例えば関数 "builtins.open" と "os.open()" は名前空間で区別されて
   います。また、どのモジュールが関数を実装しているか明示することによ
   って名前空間は可読性と保守性を支援します。例えば、"random.seed()"
   や "itertools.islice()" と書くと、それぞれモジュール "random" や
   "itertools" で実装されていることが明らかです。

namespace package
   A *package* which serves only as a container for subpackages.
   Namespace packages may have no physical representation, and
   specifically are not like a *regular package* because they have no
   "__init__.py" file.

   Namespace packages allow several individually installable packages
   to have a common parent package. Otherwise, it is recommended to
   use a *regular package*.

   For more information, see **PEP 420** and 名前空間パッケージ.

   *module* を参照してください。

native code
   Code that is compiled to machine instructions and runs directly on
   the processor, as opposed to code that is interpreted or runs in a
   virtual machine.  In the context of Python, native code typically
   refers to C, C++, Rust or Fortran code in *extension modules* that
   can be called from Python.  See also *extension module*.

nested scope
   (ネストされたスコープ) 外側で定義されている変数を参照する機能です。
   例えば、ある関数が別の関数の中で定義されている場合、内側の関数は外
   側の関数中の変数を参照できます。ネストされたスコープはデフォルトで
   は変数の参照だけができ、変数の代入はできないので注意してください。
   ローカル変数は、最も内側のスコープで変数を読み書きします。同様に、
   グローバル変数を使うとグローバル名前空間の値を読み書きします。
   "nonlocal" で外側の変数に書き込めます。

new-style class
   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 "__slots__", descriptors,
   properties, "__getattribute__()", class methods, and static
   methods.

non-deterministic
   Behavior where the outcome of a program can vary between executions
   with the same inputs.  In multi-threaded programs, non-
   deterministic behavior often results from *race conditions* where
   the relative timing or interleaving of threads affects the result.
   Proper synchronization using *locks* and other *synchronization
   primitives* helps ensure deterministic behavior.

object
   (オブジェクト) 状態 (属性や値) と定義された振る舞い (メソッド) をも
   つ全てのデータ。もしくは、全ての *新スタイルクラス* の究極の基底ク
   ラスのこと。

optimized scope
   A scope where target local variable names are reliably known to the
   compiler when the code is compiled, allowing optimization of read
   and write access to these names. The local namespaces for
   functions, generators, coroutines, comprehensions, and generator
   expressions are optimized in this fashion. Note: most interpreter
   optimizations are applied to all scopes, only those relying on a
   known set of local and nonlocal variable names are restricted to
   optimized scopes.

optional module
   An *extension module* that is part of the *standard library*, but
   may be absent in some builds of *CPython*, usually due to missing
   third-party libraries or because the module is not available for a
   given platform.

   See オプションのモジュールの要件 for a list of optional modules
   that require third-party libraries.

package
   (パッケージ) サブモジュールや再帰的にサブパッケージを含むことの出来
   る *module* のことです。専門的には、パッケージは "__path__" 属性を
   持つ Python オブジェクトです。

   *regular package* と *namespace package* を参照してください。

parallelism
   Executing multiple operations at the same time (e.g. on multiple
   CPU cores).  In Python builds with the *global interpreter lock
   (GIL)*, only one thread runs Python bytecode at a time, so taking
   advantage of multiple CPU cores typically involves multiple
   processes (e.g. "multiprocessing") or native extensions that
   release the GIL. In *free-threaded* Python, multiple Python threads
   can run Python code simultaneously on different cores.

parameter
   (仮引数) 名前付の実体で *関数* (や *メソッド* ) の定義において関数
   が受ける *実引数* を指定します。仮引数には5種類あります:

   * *位置またはキーワード*: *位置* であるいは *キーワード引数* として
     渡すことができる引数を指定します。 これはたとえば以下の *foo* や
     *bar* のように、デフォルトの仮引数の種類です:

        def func(foo, bar=None): ...

   * *位置専用*: 位置によってのみ与えられる引数を指定します。位置専用
     の引数は関数定義の引数のリストの中でそれらの後ろに "/" を含めるこ
     とで定義できます。例えば下記の *posonly1* と *posonly2* は位置専
     用引数になります:

        def func(posonly1, posonly2, /, positional_or_keyword): ...

   * *キーワード専用*: キーワードによってのみ与えられる引数を指定しま
     す。キーワード専用の引数を定義できる場所は、例えば以下の
     *kw_only1* や *kw_only2* のように、関数定義の仮引数リストに含めた
     可変長位置引数または裸の "*" の後です:

        def func(arg, *, kw_only1, kw_only2): ...

   * *可変長位置*: (他の仮引数で既に受けられた任意の位置引数に加えて)
     任意の個数の位置引数が与えられることを指定します。このような仮引
     数は、以下の *args* のように仮引数名の前に "*" をつけることで定義
     できます:

        def func(*args, **kwargs): ...

   * *可変長キーワード*: (他の仮引数で既に受けられた任意のキーワード引
     数に加えて) 任意の個数のキーワード引数が与えられることを指定しま
     す。このような仮引数は、上の例の *kwargs* のように仮引数名の前に
     "**" をつけることで定義できます。

   仮引数はオプションと必須の引数のどちらも指定でき、オプションの引数
   にはデフォルト値も指定できます。

   *仮引数* 、FAQ の 実引数と仮引数の違いは何ですか? 、
   "inspect.Parameter"  クラス、 関数定義 セクション、**PEP 362** を参
   照してください。

path entry
   *path based finder* が import するモジュールを探す *import path* 上
   の1つの場所です。

path entry finder
   "sys.path_hooks" にある callable (つまり *path entry hook*) が返し
   た *finder* です。与えられた *path entry* にあるモジュールを見つけ
   る方法を知っています。

   パスエントリーファインダが実装するメソッドについては
   "importlib.abc.PathEntryFinder" を参照してください。

path entry hook
   A callable on the "sys.path_hooks" list which returns a *path entry
   finder* if it knows how to find modules on a specific *path entry*.

path based finder
   デフォルトの *meta path finder* の1つは、モジュールの *import path*
   を検索します。

path-like object
   (path-like オブジェクト) ファイルシステムパスを表します。 path-like
   オブジェクトは、パスを表す "str" オブジェクトや "bytes" オブジェク
   ト、または "os.PathLike" プロトコルを実装したオブジェクトのどれかで
   す。 "os.PathLike" プロトコルをサポートしているオブジェクトは
   "os.fspath()" を呼び出すことで "str" または "bytes" のファイルシス
   テムパスに変換できます。 "os.fsdecode()" と "os.fsencode()" はそれ
   ぞれ "str" あるいは "bytes" になるのを保証するのに使えます。 **PEP
   519** で導入されました。

PEP
   Python Enhancement Proposal。PEP は、Python コミュニティに対して情
   報を提供する、あるいは Python の新機能やその過程や環境について記述
   する設計文書です。 PEP は、機能についての簡潔な技術的仕様と提案する
   機能の論拠 (理論) を伝えるべきです。

   PEP は、新機能の提案にかかる、コミュニティによる問題提起の集積と
   Python になされる設計決断の文書化のための最上位の機構となることを意
   図しています。PEP の著者にはコミュニティ内の合意形成を行うこと、反
   対意見を文書化することの責務があります。

   **PEP 1** を参照してください。

portion
   **PEP 420** で定義されている、namespace package に属する、複数のフ
   ァイルが (zipファイルに格納されている場合もある) 1つのディレクトリ
   に格納されたもの。

位置引数 (positional argument)
   *実引数* を参照してください。

provisional API
   (暫定 API) 標準ライブラリの後方互換性保証から計画的に除外されたもの
   です。そのようなインターフェースへの大きな変更は、暫定であるとされ
   ている間は期待されていませんが、コア開発者によって必要とみなされれ
   ば、後方非互換な変更 (インターフェースの削除まで含まれる) が行われ
   えます。このような変更はむやみに行われるものではありません -- これ
   は API を組み込む前には見落とされていた重大な欠陥が露呈したときにの
   み行われます。

   暫定 API についても、後方互換性のない変更は「最終手段」とみなされて
   います。問題点が判明した場合でも後方互換な解決策を探すべきです。

   このプロセスにより、標準ライブラリは問題となるデザインエラーに長い
   間閉じ込められることなく、時代を超えて進化を続けられます。詳細は
   **PEP 411** を参照してください。

provisional package
   *provisional API* を参照してください。

Python 3000
   Python 3.x リリースラインのニックネームです。(Python 3 が遠い将来の
   話だった頃に作られた言葉です。) "Py3k" と略されることもあります。

Pythonic
   他の言語で一般的な考え方で書かれたコードではなく、Python の特に一般
   的なイディオムに従った考え方やコード片。例えば、Python の一般的なイ
   ディオムでは "for" 文を使ってイテラブルのすべての要素に渡ってループ
   します。他の多くの言語にはこの仕組みはないので、Python に慣れていな
   い人は代わりに数値のカウンターを使うかもしれません:

      for i in range(len(food)):
          print(food[i])

   これに対し、きれいな Pythonic な方法は:

      for piece in food:
          print(piece)

qualified name
   (修飾名) モジュールのグローバルスコープから、そのモジュールで定義さ
   れたクラス、関数、メソッドへの、 "パス" を表すドット名表記です。
   **PEP 3155** で定義されています。トップレベルの関数やクラスでは、修
   飾名はオブジェクトの名前と同じです:

      >>> class C:
      ...     class D:
      ...         def meth(self):
      ...             pass
      ...
      >>> C.__qualname__
      'C'
      >>> C.D.__qualname__
      'C.D'
      >>> C.D.meth.__qualname__
      'C.D.meth'

   モジュールへの参照で使われると、*完全修飾名 (fully qualified name)*
   はすべての親パッケージを含む全体のドット名表記、例えば
   "email.mime.text" を意味します:

      >>> import email.mime.text
      >>> email.mime.text.__name__
      'email.mime.text'

race condition
   A condition of a program where the its behavior depends on the
   relative timing or ordering of events, particularly in multi-
   threaded programs.  Race conditions can lead to *non-deterministic*
   behavior and bugs that are difficult to reproduce.  A *data race*
   is a specific type of race condition involving unsynchronized
   access to shared memory.  The *LBYL* coding style is particularly
   susceptible to race conditions in multi-threaded code.  Using
   *locks* and other *synchronization primitives* helps prevent race
   conditions.

reference count
   (参照カウント) あるオブジェクトに対する参照の数。参照カウントが0に
   なったとき、そのオブジェクトは破棄されます。 *永続* であり、参照カ
   ウントが決して変更されないために割り当てが解除されないオブジェクト
   もあります。参照カウントは通常は Python のコード上には現れませんが
   、 *CPython* 実装の重要な要素です。プログラマーは、 任意のオブジェ
   クトの参照カウントを知るために "sys.getrefcount()" 関数を呼び出すこ
   とが出来ます。

   In *CPython*, reference counts are not considered to be stable or
   well-defined values; the number of references to an object, and how
   that number is affected by Python code, may be different between
   versions.

regular package
   伝統的な、 "__init__.py" ファイルを含むディレクトリとしての
   *package*。

   *namespace package* を参照してください。

reentrant
   A property of a function or *lock* that allows it to be called or
   acquired multiple times by the same thread without causing errors
   or a *deadlock*.

   For functions, reentrancy means the function can be safely called
   again before a previous invocation has completed, which is
   important when functions may be called recursively or from signal
   handlers. Thread-unsafe functions may be *non-deterministic* if
   they're called reentrantly in a multithreaded program.

   For locks, Python's "threading.RLock" (reentrant lock) is
   reentrant, meaning a thread that already holds the lock can acquire
   it again without blocking.  In contrast, "threading.Lock" is not
   reentrant - attempting to acquire it twice from the same thread
   will cause a deadlock.

   See also *lock* and *deadlock*.

REPL
   "read–eval–print loop" の頭字語で、 *対話型* インタープリターシェル
   の別名。

__slots__
   クラス内での宣言で、インスタンス属性の領域をあらかじめ定義しておき
   、インスタンス辞書を排除することで、メモリを節約します。これはよく
   使われるテクニックですが、正しく扱うには少しトリッキーなので、稀な
   ケース、例えばメモリが死活問題となるアプリケーションでインスタンス
   が大量に存在する、といったときを除き、使わないのがベストです。

sequence
   An *iterable* which supports efficient element access using integer
   indices via the "__getitem__()" special method and defines a
   "__len__()" method that returns the length of the sequence. Some
   built-in sequence types are "list", "str", "tuple", and "bytes".
   Note that "dict" also supports "__getitem__()" and "__len__()", but
   is considered a mapping rather than a sequence because the lookups
   use arbitrary *hashable* keys rather than integers.

   The "collections.abc.Sequence" abstract base class defines a much
   richer interface that goes beyond just "__getitem__()" and
   "__len__()", adding "count()", "index()", "__contains__()", and
   "__reversed__()". Types that implement this expanded interface can
   be registered explicitly using "register()". For more documentation
   on sequence methods generally, see Common Sequence Operations.

set comprehension
   (集合内包表記) iterable 内の全てあるいは一部の要素を処理して、その
   結果からなる集合を返すコンパクトな書き方です。 "results = {c for c
   in 'abracadabra' if c not in 'abc'}" とすると、"{'r', 'd'}" という
   文字列の辞書を生成します。 リスト、集合、辞書の表示 を参照してくだ
   さい。

single dispatch
   *generic function* の一種で実装は一つの引数の型により選択されます。

slice
   (スライス) 一般に *シーケンス* の一部を含むオブジェクト。スライスは
   、添字表記 "[]" で与えられた複数の数の間にコロンを書くことで作られ
   ます。例えば、 "variable_name[1:3:5]" です。角括弧 (添字) 記号は
   "slice" オブジェクトを内部で利用しています。

soft deprecated
   A soft deprecated API should not be used in new code, but it is
   safe for already existing code to use it. The API remains
   documented and tested, but will not be enhanced further.

   Soft deprecation, unlike normal deprecation, does not plan on
   removing the API and will not emit warnings.

   See PEP 387: Soft Deprecation.

special method
   (特殊メソッド) ある型に特定の操作、例えば加算をするために Python か
   ら暗黙に呼び出されるメソッド。この種類のメソッドは、メソッド名の最
   初と最後にアンダースコア 2 つがついています。特殊メソッドについては
   特殊メソッド名 で解説されています。

standard library
   The collection of *packages*, *modules* and *extension modules*
   distributed as a part of the official Python interpreter package.
   The exact membership of the collection may vary based on platform,
   available system libraries, or other criteria.  Documentation can
   be found at Python 標準ライブラリ.

   See also "sys.stdlib_module_names" for a list of all possible
   standard library module names.

statement
   (文) 文はスイート (コードの"ブロック") に不可欠な要素です。文は *式
   * かキーワードから構成されるもののどちらかです。後者には "if"、
   "while"、"for" があります。

static type checker
   An external tool that reads Python code and analyzes it, looking
   for issues such as incorrect types. See also *type hints* and the
   "typing" module.

stdlib
   An abbreviation of *standard library*.

strong reference
   In Python's C API, a strong reference is a reference to an object
   which is owned by the code holding the reference.  The strong
   reference is taken by calling "Py_INCREF()" when the reference is
   created and released with "Py_DECREF()" when the reference is
   deleted.

   The "Py_NewRef()" function can be used to create a strong reference
   to an object. Usually, the "Py_DECREF()" function must be called on
   the strong reference before exiting the scope of the strong
   reference, to avoid leaking one reference.

   See also *borrowed reference*.

synchronization primitive
   A basic building block for coordinating (synchronizing) the
   execution of multiple threads to ensure *thread-safe* access to
   shared resources. Python's "threading" module provides several
   synchronization primitives including "Lock", "RLock", "Semaphore",
   "Condition", "Event", and "Barrier".  Additionally, the "queue"
   module provides multi-producer, multi-consumer queues that are
   especially useful in multithreaded programs. These primitives help
   prevent *race conditions* and coordinate thread execution.  See
   also *lock*.

t-string
t-strings
   String literals prefixed with "t" or "T" are commonly called
   "t-strings" which is short for template string literals.

text encoding
   A string in Python is a sequence of Unicode code points (in range
   "U+0000"--"U+10FFFF"). To store or transfer a string, it needs to
   be serialized as a sequence of bytes.

   Serializing a string into a sequence of bytes is known as
   "encoding", and recreating the string from the sequence of bytes is
   known as "decoding".

   There are a variety of different text serialization codecs, which
   are collectively referred to as "text encodings".

text file
   (テキストファイル) "str" オブジェクトを読み書きできる *file object*
   です。 しばしば、テキストファイルは実際にバイト指向のデータストリー
   ムにアクセスし、 *テキストエンコーディング* を自動的に行います。 テ
   キストファイルの例は、 "sys.stdin", "sys.stdout", "io.StringIO" イ
   ンスタンスなどをテキストモード ("'r'" or "'w'") で開いたファイルで
   す。

   *bytes-like オブジェクト* を読み書きできるファイルオブジェクトにつ
   いては、 *バイナリファイル* も参照してください。

thread state
   The information used by the *CPython* runtime to run in an OS
   thread. For example, this includes the current exception, if any,
   and the state of the bytecode interpreter.

   Each thread state is bound to a single OS thread, but threads may
   have many thread states available.  At most, one of them may be
   *attached* at once.

   An *attached thread state* is required to call most of Python's C
   API, unless a function explicitly documents otherwise. The bytecode
   interpreter only runs under an attached thread state.

   Each thread state belongs to a single interpreter, but each
   interpreter may have many thread states, including multiple for the
   same OS thread. Thread states from multiple interpreters may be
   bound to the same thread, but only one can be *attached* in that
   thread at any given moment.

   See Thread State and the Global Interpreter Lock for more
   information.

thread-safe
   A module, function, or class that behaves correctly when used by
   multiple threads concurrently.  Thread-safe code uses appropriate
   *synchronization primitives* like *locks* to protect shared mutable
   state, or is designed to avoid shared mutable state entirely.  In
   the *free-threaded* build, built-in types like "dict", "list", and
   "set" use internal locking to make many operations thread-safe,
   although thread safety is not necessarily guaranteed.  Code that is
   not thread-safe may experience *race conditions* and *data races*
   when used in multi-threaded programs.

トークン
   A small unit of source code, generated by the lexical analyzer
   (also called the *tokenizer*). Names, numbers, strings, operators,
   newlines and similar are represented by tokens.

   The "tokenize" module exposes Python's lexical analyzer. The
   "token" module contains information on the various types of tokens.

triple-quoted string
   (三重クォート文字列) 3つの連続したクォート記号(")かアポストロフィー
   (')で囲まれた文字列。通常の(一重)クォート文字列に比べて表現できる文
   字列に違いはありませんが、幾つかの理由で有用です。1つか2つの連続し
   たクォート記号をエスケープ無しに書くことができますし、行継続文字(\)
   を使わなくても複数行にまたがることができるので、ドキュメンテーショ
   ン文字列を書く時に特に便利です。

type
   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
   "__class__" attribute or can be retrieved with "type(obj)".

type alias
   (型エイリアス) 型の別名で、型を識別子に代入して作成します。

   型エイリアスは *型ヒント* を単純化するのに有用です。例えば:

      def remove_gray_shades(
              colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:
          pass

   これは次のようにより読みやすくできます:

      Color = tuple[int, int, int]

      def remove_gray_shades(colors: list[Color]) -> list[Color]:
          pass

   機能の説明がある "typing" と **PEP 484** を参照してください。

type hint
   (型ヒント) 変数、クラス属性、関数のパラメータや返り値の期待される型
   を指定する *annotation* です。

   Type hints are optional and are not enforced by Python but they are
   useful to *static type checkers*. They can also aid IDEs with code
   completion and refactoring.

   グローバル変数、クラス属性、関数で、ローカル変数でないものの型ヒン
   トは "typing.get_type_hints()" で取得できます。

   機能の説明がある "typing" と **PEP 484** を参照してください。

universal newlines
   テキストストリームの解釈法の一つで、以下のすべてを行末と認識します:
   Unix の行末規定 "'\n'"、Windows の規定 "'\r\n'"、古い Macintosh の
   規定 "'\r'"。利用法について詳しくは、 **PEP 278** と **PEP 3116**
   、さらに "bytes.splitlines()" も参照してください。

variable annotation
   (変数アノテーション) 変数あるいはクラス属性の *annotation* 。

   変数あるいはクラス属性に注釈を付けたときは、代入部分は任意です:

      class C:
          field: 'annotation'

   変数アノテーションは通常は *型ヒント* のために使われます: 例えば、
   この変数は "int" の値を取ることを期待されています:

      count: int = 0

   変数アノテーションの構文については 注釈付き代入文 (annotated
   assignment statements) 節で解説しています。

   機能の説明がある *function annotation*,  **PEP 484** , **PEP 526**
   を参照してください。また、アノテーションを利用するベストプラクティ
   スとして Annotations Best Practices も参照してください。

virtual environment
   (仮想環境) 協調的に切り離された実行環境です。これにより Python ユー
   ザとアプリケーションは同じシステム上で動いている他の Python アプリ
   ケーションの挙動に干渉することなく Python パッケージのインストール
   と更新を行うことができます。

   "venv" を参照してください。

virtual machine
   (仮想マシン) 完全にソフトウェアにより定義されたコンピュータ。
   Python の仮想マシンは、バイトコードコンパイラが出力した *バイトコー
   ド* を実行します。

walrus operator
   A light-hearted way to refer to the assignment expression operator
   ":=" because it looks a bit like a walrus if you turn your head.

Zen of Python
   (Pythonの悟り) Python を理解し利用する上での導きとなる、Python の設
   計原則と哲学をリストにしたものです。対話プロンプトで ""import
   this"" とするとこのリストを読めます。
