Python Internals

9 videos 9 essays


How "is" operator is implemented in python?

437 views 26 likes 2021-05-31

In this video, we find out the internals of "is" operator in Python. We go through the CPython source code and answer ho...

How id() function is implemented in python?

277 views 14 likes 2021-05-24

How is `id` function implemented in Python? In this video, we explore the internals of `id` function in Python and find...

How python compares a float and an int objects?

255 views 9 likes 2021-05-13

How python internally performs the comparison of a float and an integer value? We find this out in this video. Compari...

How python optimizes integers?

246 views 24 likes 2021-05-06

In this video, we answer, How python optimizes integers? Does it cache them? We go through the CPython source code to fi...

How python implements chained comparison operators?

199 views 13 likes 2021-04-28

In this essay, we explore how python evaluates chained comparison operators. We dive deep into the code and answer the f...

How python optimizes strings using String Interning?

472 views 19 likes 2021-04-13

In this video, we dive deep into CPython and find out how Python optimizes strings. The optimization we will be going th...

Changing python grammar to support standalone walrus assignments

496 views 27 likes 2021-04-08

In this video, we alter the Python grammar and make an invalid syntax valid. We alter grammar and allow the Walrus opera...

Setting up cpython locally and making your first change

953 views 49 likes 2021-04-04

In this video, we set up CPython, build our binary, and make our first "Hello, World!" change. CPython Github Repositor...

Series Introduction: The Honest Python

870 views 38 likes 2021-04-03

The Honest Python is a series in which we dissect certain features, behaviors, and not-so-obvious outputs by diving deep...


Chained Comparison Operators in Python

275 reads 2021-04-27

In this essay, we find how chained comparison expressions are evaluated, understand how short-circuit evaluations happen...

The Weird Walrus

2377 reads 2021-03-29

In this essay, we alter the Python Grammar and allow it run Assignment Expressions without any parenthesis....

Constant Folding in Python

3917 reads 2021-01-10

Every programming language aims to be performant and Python is no exception. In this essay, we dive deep into Python int...

String Interning in Python

1480 reads 2020-12-20

Every programming language aims to be performant and Python is no exception. In this essay, we dive deep into Python int...

Making Python Integers Iterable

1790 reads 2020-06-14

In Python, Integers are not iterables but we can make them iterable by implementing __iter__ function. In this essay, we...

Integer Caching in Python

1824 reads 2020-05-17

To gain a performance boost and avoid reallocation of frequently used integers, Python creates singleton instances of sm...

Function Overloading in Python

12359 reads 2020-02-07

Python natively does not support function overloading - having multiple functions with the same name. Today we see how w...

Super Long Integers in Python

3584 reads 2020-01-10

Python must be doing something beautiful internally to support super long integers and today we find out what's under th...

Changing Python

1121 reads 2020-01-03

I changed the Python's source code and made addition incorrect and unpredictable. The addition operation will internally...

Arpit's Newsletter read by 14000+ engineers

🔥 Thrice a week, in your inbox, an essay about system design, distributed systems, microservices, programming languages internals, or a deep dive on some super-clever algorithm, or just a few tips on building highly scalable distributed systems.

  • v10.6.4
  • © Arpit Bhayani, 2022