From source to a code object
Running Python is two phases. First the compiler turns source into bytecode, a flat sequence of instructions for a virtual machine. Then the interpreter executes that bytecode. The compile step is not hidden; you can trigger it directly.
src = 'x = a + b'
code = compile(src, '<demo>', 'exec')
type(code) # <class 'code'>
code.co_code # raw bytes of the instructions
A code object is the compiled unit for one module, function, or comprehension. Functions carry theirs on func.__code__. Bytecode is cached to .pyc files under __pycache__ so the compile step is skipped next time, but execution is identical whether the bytecode came from source or a cached file. CPython is a bytecode interpreter, not a machine-code compiler: there is no ahead-of-time step to native code.

