本手册记录了希望编写扩展模块或嵌入 Python 的 C 和 C 程序员使用的 API。它是扩展和嵌入 Python 解释器的伴侣,扩展和嵌入 Python 解释器描述了扩展编写的一般原理,但未详细记录 API 函数。
Introduction
Coding standards
Include Files
Useful macros
对象,类型和引用计数
Exceptions
Embedding Python
Debugging Builds
稳定的应用程序二进制接口
高层层
Reference Counting
Exception Handling
打印和清除
Raising exceptions
Issuing warnings
查询错误指示
Signal Handling
Exception Classes
Exception Objects
Unicode 异常对象
Recursion Control
Standard Exceptions
标准警告类别
Utilities
osUtil
System Functions
Process Control
Importing Modules
数据编组支持
解析参数和构建值
字符串转换和格式化
Reflection
编解码器注册和支持Function
抽象对象层
Object Protocol
Number Protocol
Sequence Protocol
Mapping Protocol
Iterator Protocol
Buffer Protocol
旧缓冲协议
具体对象层
Fundamental Objects
Numeric Objects
Sequence Objects
Container Objects
Function Objects
Other Objects
初始化,完成和线程
在 Python 初始化之前
全局配置变量
初始化和完成解释器
Process-wide parameters
线程状态和全局解释器锁定
Sub-interpreter support
Asynchronous Notifications
分析和跟踪
高级调试器支持
线程本地存储支持
Python 初始化配置
PyWideStringList
PyStatus
PyPreConfig
使用 PyPreConfig 进行预初始化
PyConfig
用 PyConfig 初始化
Isolated Configuration
Python Configuration
Path Configuration
Py_RunMain()
多阶段初始化专用临时 API
Memory Management
Overview
原始内存接口
Memory Interface
Object allocators
默认内存分配器
自定义内存分配器
pymalloc 分配器
tracemalloc C API
Examples
对象实施支持
在堆上分配对象
通用对象结构
Type Objects
数字对象结构
Map 对象结构
序列对象结构
缓冲区对象结构
异步对象结构
插槽类型 typedefs
支持循环垃圾收集
API 和 ABI 版本控制