mirror of
https://github.com/python/cpython.git
synced 2025-12-31 12:33:28 +00:00
Co-Authored-By: Paul Ross <apaulross@gmail.com> Co-Authored-By: Carol Willing <carolcode@willingconsulting.com> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-Authored-By: Ezio Melotti <ezio.melotti@gmail.com> Co-Authored-By: Adam Turner <9087854+aa-turner@users.noreply.github.com>
1.3 KiB
1.3 KiB
CPython source code
This section gives an overview of CPython's code structure and provides a summary of file locations for modules and built-ins.
Source code layout
For a Python module, the typical layout is:
Lib/<module>.pyModules/_<module>.c(if there's also a C accelerator module)Lib/test/test_<module>.pyDoc/library/<module>.rst
For an extension module, the typical layout is:
Modules/<module>module.cLib/test/test_<module>.pyDoc/library/<module>.rst
For builtin types, the typical layout is:
Objects/<builtin>object.cLib/test/test_<builtin>.pyDoc/library/stdtypes.rst
For builtin functions, the typical layout is:
Some exceptions to these layouts are:
- built-in type
intis atObjects/longobject.c - built-in type
stris atObjects/unicodeobject.c - built-in module
sysis atPython/sysmodule.c - built-in module
marshalis atPython/marshal.c - Windows-only module
winregis atPC/winreg.c