
Unlock the Secrets Behind Every Line of Python Code
Book Description
Python is one of the world's most popular programming languages but what actually happens when your code runs? CPython Internals Explained pulls back the curtain on Python's official interpreter, walking you through the complete journey from source code to execution with hands-on examples at every step.
Starting with building CPython from scratch, you'll explore the PEG parser, the tokenizer, abstract syntax trees, and the bytecode compiler. You'll step inside the evaluation loop of the virtual machine, understand stack-based execution and frame objects, and learn how inline caching and adaptive specialization (PEP 659) make modern Python fast. The book then dives deep into memory management covering reference counting, generational garbage collection, and debugging memory leaks with tracemalloc.
You'll master Python's object model, discovering how integers, strings, lists, and dictionaries are implemented in C. Concurrency gets full coverage too: the GIL, threads, multiprocessing, async/await internals, and the new free-threading model (PEP 703). Later chapters cover profiling with cProfile and perf, the Faster CPython project, JIT compilation (PEP 744), testing and debugging with GDB/LLDB, and writing your own C extensions using Cython, pybind11, and HPy.
What You Will Learn
Who This Book Is For
This book is for intermediate to advanced Python developers who want to go beyond application code and truly understand how Python works under the hood. It's ideal for engineers optimizing performance-critical systems, developers contributing to CPython or open source projects, and curious programmers who want to understand what really happens when Python runs. A basic familiarity with Python is assumed; prior C knowledge is helpful but not required a C primer for Python programmers is included.
Es wurden noch keine Bewertungen abgegeben. Schreiben Sie die erste Bewertung zu "CPython Internals Explained" und helfen Sie damit anderen bei der Kaufentscheidung.