How python/cpython works
CPython is the reference Python interpreter and its standard library. The principal workflow starts when a user invokes the interpreter: its native entry point selects startup, script, or interactive behavior, with an interactive route into the Python REPL. The wider runtime provides core language services and standard-library capabilities such as I/O, networking, concurrency, and data handling. Edges below are limited to calls visible in excerpts or dependencies named by the SOURCE INDEX; unsampled runtime internals are not expanded into an assumed pipeline.
Main entry points: os.py OS interface · message.py Email messages · http/server.py HTTP server · xmlrpc/server.py XML-RPC server
Components 20
Interpreter runtime
- Interpreter entry
Modules/main.c - Interactive REPL
Lib/_pyrepl/main.py
Core libraries
- OS interface
Lib/os.py - Stream I/O
Lib/io.py - Warnings
Lib/warnings.py - Type utilities
Lib/types.py - CLI parsing
Lib/argparse.py
Networking
- HTTP client
Lib/http/client.py - HTTP server
Lib/http/server.py - XML-RPC server
Lib/xmlrpc/server.py
Concurrency
- Async tasks
Lib/asyncio/tasks.py - Shared-object managers
Lib/multiprocessing/managers.py
Data and utilities
- Regular expressions
Lib/re/__init__.py - Email messages
Lib/email/message.py - Email charsets
Lib/email/charset.py - Object introspection
Lib/inspect.py - Traceback formatting
Lib/traceback.py - Function utilities
Lib/functools.py - Test runner
Lib/unittest/main.py
Other components
- Python user
Connections 19
- Python user → Interpreter entry: invokes
README.rst - Interpreter entry → Interactive REPL: starts interactive
Modules/main.c - Interpreter entry → OS interface: imports
Modules/main.c - Interactive REPL → OS interface: imports
Lib/_pyrepl/main.py - HTTP server → HTTP client: imports
Lib/http/server.py - HTTP server → OS interface: imports
Lib/http/server.py - HTTP server → CLI parsing: imports
Lib/http/server.py - XML-RPC server → HTTP server: imports
Lib/xmlrpc/server.py - XML-RPC server → Object introspection: imports
Lib/xmlrpc/server.py - XML-RPC server → Traceback formatting: imports
Lib/xmlrpc/server.py - Async tasks → Type utilities: imports
Lib/asyncio/tasks.py - Shared-object managers → OS interface: imports
Lib/multiprocessing/managers.py - Email messages → Stream I/O: imports
Lib/email/message.py - Email messages → Email charsets: imports
Lib/email/message.py - Email messages → Regular expressions: imports
Lib/email/message.py - Email messages → Function utilities: imports
- Test runner → CLI parsing: imports
Lib/unittest/main.py - Test runner → OS interface: imports
Lib/unittest/main.py - Warnings → OS interface: used by
Lib/os.py