Table of contents 一、简介 1.1 如何使用此书 1.2 额外材料和学习资料 二、获取 CPython 源码 三、准备你的开发环境 3.1 选IDE还是编辑器? 3.2 安装Visual Studio 3.3 安装Visual Studio Code 3.4 安装JetBrains Clion 3.5 安装Vim 3.6 总结 四、编译 CPython 4.1 在 macOS 上编译 CPython 4.2 在 Linux 上编译 CPython 4.3 安装自定义版本 4.4 make 快速入门 4.5 CPython 的 make 目标 4.6 在 Windows 上编译 CPython 4.7 PGO 优化 4.8 总结 五、Python 语言和语法 5.1 为什么 CPython 是用 C 语言而不是用 Python 语言来实现 5.2 Python 语言规范 5.3 使用解析器生成器 5.4 解析器生成器 5.5 重新生成语法 5.6 一个更复杂的示例 5.7 总结 六、配置和输入 6.1 配置状态 6.2 构建配置 6.3 从输入构建模块 6.4 总结 七、语法树解析 7.1 具象语法树生成器 7.2 CPython 解析器-词法分析器 7.3 抽象语法树 7.4 要记住的术语 7.5 一个示例:添加几乎相等比较运算法 7.6 总结 八、编译器 九、求值循环 9.1 构建线程状态 9.2 构建帧对象 9.3 帧的执行 9.4 值栈 9.5 例子:在列表中添加元素 9.6 总结 十、内存管理 10.1 C 中的内存分配 10.2 Python 内存管理系统设计 十一、并行和并发 十二、对象和类型 十三、标准库 13.1 Python 模块 13.2 Python 和 C 模块 十四、测试套 十五、调试 十六、基准测试,性能分析,追踪 十七、总结 附录