CPython Internals: Your Guide to the Python 3 Interpreter

Are there certain parts of Python that just seem like magic? Like how dictionaries are so much faster than looping over a list to find an item. How does a generator remember the state of the variables each time it yields a value and why do you never have to allocate memory like other languages? It turns out, CPython, the most popular Python runtime is written in human-readable C and Python code.

This book will explain the concepts, ideas and technicalities of CPython.

We’ll cover all the concepts behind the internals of CPython, how they work with visual explanations as you go.

You’ll learn how to:

  • Read and navigate the source code
  • Compile CPython from source code
  • Navigate and comprehend the inner workings of concepts like lists, dictionaries, and generators
  • Run the test suite
  • Modify or upgrade components of the CPython library to contribute them to future versions

Take your time for each chapter and make sure you try out the demos and the interactive components. You’ll soon feel a sense of achievement that you grasp the core concepts of Python that can make you a better Python programmer.

What’s Included:

Downloadable Resources:

Related Learning Paths:

CPython Internals: Your Guide to the Python 3 Interpreter

2 Lessons

About Anthony Shaw

Anthony Shaw Anthony Shaw

Anthony is an avid Pythonista and writes for Real Python. Anthony is a Fellow of the Python Software Foundation and member of the Open-Source Apache Foundation.

» More about Anthony

Participant Comments

oglop on Dec. 1, 2020

Great information and AWESOME formatting! This is how modern tech books should look. So easy to read the code examples. Thanks for the book and awesome site!

Nick Dat Le on June 25, 2020

Great work Anthony et al! Just the resource I’ve been looking for :)

« Browse All Courses