Important
This is part of a Draft of the Python Contributor’s Guide. Text in square brackets are notes about content to fill in. Currently, the devguide and this new Contributor’s Guide co-exist in the repo. We are using Sphinx include directives to demonstrate the re-organization. The final Contributor’s Guide will replace the devguide with content in only one place. We welcome help with this!
The [Plan for the Contributor’s Guide] page has more details about the current state of this draft and how you can help. See more info about the Contributor Guide in the discussion forum: Refactoring the DevGuide.
Directory structure¶
[This is the Directory structure section from the devguide.]
There are several top-level directories in the CPython source tree. Knowing what each one is meant to hold will help you find where a certain piece of functionality is implemented. Do realize, though, there are always exceptions to every rule.
DocThe official documentation. This is what https://docs.python.org/ uses. See also Building the documentation.
GrammarContains the EBNF grammar file for Python.
IncludeContains all interpreter-wide header files.
LibThe part of the standard library implemented in pure Python.
MacMac-specific code (for example, using IDLE as a macOS application).
MiscThings that do not belong elsewhere. Typically this is varying kinds of developer-specific documentation.
ModulesThe part of the standard library (plus some other code) that is implemented in C.
ObjectsCode for all built-in types.
PCWindows-specific code.
PCbuildBuild files for the version of MSVC currently used for the Windows installers provided on python.org.
ParserCode related to the parser. The definition of the AST nodes is also kept here.
ProgramsSource code for C executables, including the main function for the CPython interpreter.
PythonThe code that makes up the core CPython runtime. This includes the compiler, eval loop and various built-in modules.
ToolsVarious tools that are (or have been) used to maintain Python.