In this video we are going to explore BYTECODE(opcode) from ceval.c for simple question?

Why and how we see this ‘int’ ibject is not iterable error? How is it checked behind the scene?

If you can master the bytecode — you can easily learn what is your code doing internally.


This short video describes how compiled code object can be used in order to change function behavior.
This is an extra bonus video to future code object and function object topics.


This video is a simple intro to CPython’s
compiler part — from Tokenization — Abstract Syntax Tree — and compiling to bytecodes.
For sake of simplicity most of the details were omitted — but it is highly recommended to watch to this video.
*Again This is not a full and complete description of the topic.*


In this video we are going to explore the bool type implementation in Python, what is True & False and how to make changes to CPython source code in order to change bool type behavior.
Basically bool is sub-type of integer…

In this short video we are going to finalize the NoneType exploration in CPython.
We are going to add some useless changes to None object such as returnin True from __bool__() call or returning integer type for NoneType type call.

The code changes are here:

In this video we are going to explore CPython source code and NoneType implementation internally.
As a bonus we are using GDB to create NoneType objects using Python/C API. After this video we are ready to change None object to do the most useless things.

In this video we are going to make our first steps towards NoneType object implementation in Python. Basically what is “==” and “is” under the hood and how None object is unique in term of memory allocation.

In this video we are going to further add extra useless feature to CPython source code — at the end of the video we will have __len__ and len() support for Integer type in Python.
It will always simply return 0.
We do not need this feature at all but we want it right now :)
You can see necessary code changes from here:

*Again those shown things are not for best practice or for contribution, the pure goal is to learn something new by doing something wrong*

In this video we are going to explore how the list type was created in CPython and how to create list object using Python C/API call.
The topic is interesting because we are going to use this information to add __len__() support to integer type in our 4th video.

Note: *again the ideas and cases are not shown as best practice approach*

In this video, we are going to explore how to use debugger(GDB) and our very own Python 3.9 version to sum 2 integers and then print it to console using internal Python/C API.

We will learn:
* How to start Python interpreter within debugger?
* Explore various integer type methods and how to call them directly from debugger?
* How to sum 2 integers and understand what is actually happens internally.

Shahriyar Rzayev

Azerbaijan Python User Group lead — True Pythonista. Golang Engineer. Bug hunter by nature

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store