cpython
The Python programming language
CPython is the official Python interpreter, the software that runs when you type `python` on your machine. This repo contains the C source code for the language runtime, standard library, and build system.
This is CPython, the official reference implementation of the Python programming language. When you install Python on your computer and run a Python script, this is almost certainly the software doing the work. CPython is what converts your Python code into instructions a computer can execute. The problem it solves is foundational: it provides the runtime engine, standard library, and tooling that makes the Python language actually usable on real computers.
CPython works by parsing Python source code, compiling it into an intermediate format called bytecode, and then executing that bytecode in a virtual machine. The repository contains the interpreter itself (written primarily in C for performance), the entire Python standard library (the built-in modules that come with any Python installation like os, json, and math), a build system for compiling the interpreter from source on Unix, macOS, and Windows, and a comprehensive test suite. The README describes this as version 3.15.0 alpha 8, meaning it is a pre-release development version. It also mentions optimization techniques like Profile Guided Optimization and Link Time Optimization, which are compiler-level techniques to make the final interpreter binary faster.
You would look at this repository if you are contributing to Python development itself, investigating a bug in the language or standard library, building a custom Python distribution, or learning how programming language runtimes work at a deep level. Everyday Python developers do not need to interact with this repository directly; they just install Python from python.org. The primary language is C for the interpreter core, with Python used for the standard library and build tooling. The project is governed by the Python Software Foundation under an open-source license.
Where it fits
- Contribute a bug fix or new feature to the Python language itself by modifying the C interpreter source.
- Investigate the root cause of a Python interpreter bug by tracing the relevant C or Python standard library code.
- Build a custom Python distribution with specific patches for an embedded system or specialized environment.
- Study how a programming language runtime works under the hood by reading the bytecode compiler and virtual machine source.