Snapshotmain · c144799
How the reference Python implementation parses a script, produces bytecode, evaluates objects, and imports more code.
Click a building or route
System map8 components · 9 connections
130%
Connections
BuildingsEntryServiceComputeStorageRuntimeToolingExternal
Terms, in plain English
PEG parserA Parsing Expression Grammar parser chooses ordered grammar alternatives and can express Python's syntax directly.
How to study this repo
- 1Watch source become bytecode
Use Python's `ast` and `dis` modules on a tiny function, then match those two representations to Parser/pegen.c and Python/compile.c.
- 2Trace one instruction
Choose a familiar opcode in Python/bytecodes.c and follow the object protocol calls and reference-count changes it performs.
- 3Study an import miss
Follow _find_and_load in importlib/_bootstrap.py and note the cache checks, lock, module creation, execution, and cleanup order.