What is Python written in?
Quick Facts
- Short answer
- CPython is written primarily in C
- Language spec
- Implementation-independent
- Main runtime
- CPython
- Other implementations
- PyPy, Jython, IronPython
Details
When people ask "what is Python written in?" they usually mean the CPython implementation language. CPython is the reference implementation maintained by the Python Software Foundation. Its interpreter core, object model, memory allocator, and C API are implemented primarily in C, with many higher-level library modules written in Python.
Because its core is written in C, Python is often said to be "built on C". However, Python as a language specification is separate from any particular implementation. The specification does not require C. CPython is simply the dominant runtime and the behavior most people mean when they say "Python."
Python implementation layers
| Layer | Written in | Role |
|---|---|---|
| CPython core | C | Interpreter, object model, memory management, C API |
| Standard library | Python and C | Built-in modules, libraries, extension modules |
| Alternative runtimes | RPython, Java, C# | PyPy, Jython, IronPython |
The dataset records a runtime_written_in relationship from C to Python because CPython is the reference and most widely deployed Python runtime.
Explore in the Graph
See implementation and influence relationships interactively.
Open Interactive Graph →