Leanpub, 2018. — 125 p.
The Python Programming language has been around for quite a while. Development work was started on the first version by Guido Van Rossum in 1989 and it has since grown to become one of the more popular languages that has been used in applications ranging from graphical interfaces to financial and data analysis applications. This write-up aims to go behind the scene of the Python interpreter and provide a conceptual overview of how a python program is executed. This material targets
CPython which as of this writing is the most popular implementation of Python and is considered the standard. Book is aimed at anybody who is interested in gaining some insight into how the CPython virtual machine functions. It is assumed that the user is already familiar with Python and understands the fundamentals of the language. As part of this expose on the virtual machine, we go through a considerable amount of C code so a user that has a rudimentary understanding of C will find it easier to follow. After all said and done, all that is needed to get through this material is a healthy desire to want to learn about the CPython virtual machine. At the end of this book, a user should be able to understand the intricacies of how the Python interpreter executes a program. This includes the various steps involved in executing the program and the various data structures that are crucial to the execution of such program.
The View From 30,000ft.
Compiling Python Source Code.
Python Objects.
Code Objects.
Frames Objects.
Interpreter and Thread States.
Intermezzo: The abstract.c Module.
The evaluation loop, ceval.c.
The Block Stack.
From Class code to bytecode.
Generators: Behind the scenes.