This section gives an overview of CPython's code structure and provides a summary of file locations for modules and built-ins.
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>.rstFor an extension module, the typical layout is:
Modules/<module>module.cLib/test/test_<module>.pyDoc/library/<module>.rstFor builtin types, the typical layout is:
Objects/<builtin>object.cLib/test/test_<builtin>.pyDoc/library/stdtypes.rstFor builtin functions, the typical layout is:
Some exceptions to these layouts are:
int is at Objects/longobject.cstr is at Objects/unicodeobject.csys is at Python/sysmodule.cmarshal is at Python/marshal.cwinreg is at PC/winreg.c