Python/C API reference manual
*****************************

このマニュアルでは、拡張モジュールを書いたり Python インタプリタをアプ
リケーションに埋め込んだりしたい C/C++ プログラマが利用できる API につ
いて述べています。 Python インタプリタの拡張と埋め込み は拡張モジュー
ルを書く際の一般的な決まりごとについて記述していますが、 API の詳細ま
では記述していないので、このドキュメントが手引きになります。

* はじめに

  * 言語バージョン互換性

  * コーディング基準

  * インクルードファイル

  * 便利なマクロ

  * オブジェクト、型および参照カウント

  * 例外

  * Python の埋め込み

  * デバッグ版ビルド (Debugging Builds)

  * おすすめのサードパーティツール

* C API and ABI Stability

  * Unstable C API

  * Stable Application Binary Interfaces

  * プラットフォームで考慮すべき点

  * ABI Checking

  * 限定版APIの内容

* 超高水準レイヤ

  * Available start symbols

  * Stack Effects

* 参照カウント

* 例外処理

  * 出力とクリア

  * 例外の送出

  * 警告

  * エラーインジケータの問い合わせ

  * シグナルハンドリング

  * 例外クラス

  * 例外オブジェクト

  * Unicode 例外オブジェクト

  * 再帰の管理

  * Exception and warning types

  * Tracebacks

* 拡張モジュールの定義

  * Extension export hook

  * 多段階初期化

  * 複数のモジュールインスタンス

  * "PyInit" function

* Definition slots

  * Convenience macros

  * Common slot IDs

* ユーティリティ

  * オペレーティングシステム関連のユーティリティ

  * システム関数

  * プロセス制御

  * モジュールのインポート

  * データ整列化 (data marshalling) のサポート

  * 引数の解釈と値の構築

  * 文字列の変換と書式化

  * Character classification and conversion

  * PyHash API

  * リフレクション

  * codec レジストリとサポート関数

  * PyTime C API

  * Support for Perf Maps

* 抽象オブジェクトレイヤ (Abstract Objects Layer)

  * オブジェクトプロトコル (object protocol)

  * Call プロトコル

  * 数値型プロトコル (number protocol)

  * シーケンス型プロトコル (sequence protocol)

  * マップ型プロトコル (mapping protocol)

  * イテレータプロトコル (iterator protocol)

  * バッファプロトコル (buffer Protocol)

* 具象オブジェクト (concrete object) レイヤ

  * 基本オブジェクト (fundamental object)

  * 数値型オブジェクト (numeric object)

  * シーケンスオブジェクト (sequence object)

  * Container オブジェクト

  * Function オブジェクト

  * その他のオブジェクト

  * C API for extension modules

* インタープリタの初期化と終了処理

  * Before Python initialization

  * グローバルな設定変数

  * インタープリタの初期化と終了処理

  * Cautions regarding interpreter finalization

  * Interpreter views

  * プロセスワイドのパラメータ

* Thread states and the global interpreter lock

  * Detaching the thread state from extension code

  * Using the C API from foreign threads

  * GIL-state APIs

  * Cautions about fork()

  * 高水準 API

  * 低水準 API

* Asynchronous notifications

* Operating system thread APIs

* 同期プリミティブ

  * Python critical section API

  * Legacy locking APIs

* Thread-local storage support

  * Thread-specific storage API

  * Dynamic allocation

  * メソッド

  * Legacy APIs

* Multiple interpreters in a Python process

  * A per-interpreter GIL

  * バグと注意事項

  * 高水準 API

  * 低水準 API

  * Advanced debugger support

* Profiling and tracing

* Reference tracing

* Python 初期化設定

  * PyInitConfig C API

  * Configuration Options

  * Runtime Python configuration API

  * PyConfig C API

  * Py_GetArgcArgv()

  * Multi-Phase Initialization Private Provisional API

* メモリ管理

  * 概要

  * Allocator Domains

  * 生メモリインターフェース

  * メモリインターフェース

  * オブジェクトアロケータ

  * Default Memory Allocators

  * メモリアロケータをカスタマイズする

  * Debug hooks on the Python memory allocators

  * pymalloc アロケータ

  * The mimalloc allocator

  * tracemalloc C API

  * 使用例

* オブジェクト実装サポート (object implementation support)

  * Allocating objects on the heap

  * Object Life Cycle

  * 共通のオブジェクト構造体 (common object structure)

  * Type Object Structures

  * 循環参照ガベージコレクションをサポートする

* API と ABI のバージョニング

  * Build-time version constants

  * Run-time version

  * Bit-packing macros

* Monitoring C API

* Generating Execution Events

  * Managing the Monitoring State
