Python/C API Reference Manual
*****************************

This manual documents the API used by C and C++ programmers who want
to write extension modules or embed Python.  It is a companion to
Extending and Embedding the Python Interpreter, which describes the
general principles of extension writing but does not document the API
functions in detail.

* Introduction

  * Language version compatibility

  * Coding standards

  * Include Files

  * Useful macros

  * Objects, Types and Reference Counts

  * Exceptions

  * Embedding Python

  * Debugging Builds

  * Recommended third party tools

* C API Stability

  * Unstable C API

  * Stable Application Binary Interface

  * Platform Considerations

  * Contents of Limited API

* The Very High Level Layer

* Reference Counting

* Exception Handling

  * Printing and clearing

  * Raising exceptions

  * Issuing warnings

  * Querying the error indicator

  * Signal Handling

  * Exception Classes

  * Exception Objects

  * Unicode Exception Objects

  * Recursion Control

  * Exception and warning types

* Defining extension modules

  * Multiple module instances

  * Initialization function

  * Multi-phase initialization

  * Legacy single-phase initialization

* Utilities

  * Operating System Utilities

  * System Functions

  * Process Control

  * Importing Modules

  * Data marshalling support

  * Parsing arguments and building values

  * String conversion and formatting

  * PyHash API

  * Reflection

  * Codec registry and support functions

  * PyTime C API

  * Support for Perf Maps

* Abstract Objects Layer

  * Object Protocol

  * Call Protocol

  * Number Protocol

  * Sequence Protocol

  * Mapping Protocol

  * Iterator Protocol

  * Buffer Protocol

* Concrete Objects Layer

  * Fundamental Objects

  * Numeric Objects

  * Sequence Objects

  * Container Objects

  * Function Objects

  * Other Objects

* Initialization, Finalization, and Threads

  * Before Python Initialization

  * Global configuration variables

  * Initializing and finalizing the interpreter

  * Process-wide parameters

  * Thread State and the Global Interpreter Lock

  * Sub-interpreter support

  * Asynchronous Notifications

  * Profiling and Tracing

  * Reference tracing

  * Advanced Debugger Support

  * Thread Local Storage Support

  * Synchronization Primitives

* Python Initialization Configuration

  * PyInitConfig C API

  * Configuration Options

  * Runtime Python configuration API

  * PyConfig C API

  * Py_GetArgcArgv()

  * Delaying main module execution

* Memory Management

  * Overview

  * Allocator Domains

  * Raw Memory Interface

  * Memory Interface

  * Object allocators

  * Default Memory Allocators

  * Customize Memory Allocators

  * Debug hooks on the Python memory allocators

  * The pymalloc allocator

  * The mimalloc allocator

  * tracemalloc C API

  * Examples

* Object Implementation Support

  * Allocating Objects on the Heap

  * Object Life Cycle

  * Common Object Structures

  * Type Object Structures

  * Supporting Cyclic Garbage Collection

* API and ABI Versioning

  * Build-time version constants

  * Run-time version

  * Bit-packing macros

* Monitoring C API

* Generating Execution Events

  * Managing the Monitoring State
