写在前面
如果对Python源码感兴趣,那“窥探”其实现的最佳方式就是调教它,不,调试它。
获取源代码
源代码的组织
解压后,目录结构如下
{ Python-3.8.0 } » tree -d -L 1 .
.
├── Doc # rst(reStructuredText)格式官方文档,用其生成https://docs.python.org/
├── Grammar # Python的EBNF(Extended Backus–Naur form)语法定义文件
├── Include # .h 头文件
├── Lib # .py 纯Python实现的标准库
├── m4 # ?
├── Mac # Mac-specific code,支持MacOS
├── Misc # Things that do not belong elsewhere.
├── Modules # C实现的标准库,内含.c .asm .macros .h
├── Objects # 内置数据类型实现
├── Parser # Python语法分析器源码
├── PC # Windows-specific code,支持Windows
├── PCbuild # Windows生成文件,for MSVC
├── Programs # main函数