The documents inside the InternalDocs are sufficient to help you gain a general understanding of the internal components of CPython. However, I suggest adding a statement-driven tutorial, let’s say, a “statement_tutorial.md” file, inside InternalDocs, explaining how to add a new statement to Python in a step-by-step tutorial. In that case, we will help the maintainers and contributors understand the internal components straightforwardly, using one example. The “statement_tutorial.md” file will build an imaginary statement and use it to explain, for example:
-
Tokens
-
ASDL
-
PEG Grammar
-
Parsing
-
AST
-
Compilation
-
Validation
-
Symbol Table
-
Code Generation
-
Bytecode
-
Execution
-
…
By contributing to that document from time to time, we can build a clean, robust, and elegant tutorial that helps developers grasp the big picture and understand CPython’s internals easily.
Note: My point is about the idea itself, regardless of how it will be applied.