Python 3.14 - Exploring GIL free code
by Anand, post on Mon 20 October 2025The GIL
Python has a global lock that has to be accessed by the current running thread as the interpreter is not fully thread safe. This is called the GIL or Global Interpreter Lock.
Since Python 3.13, the core developers of Python have been working on a free-thread implementation …
Slots and the Zen of Python
by Anand, post on Mon 13 October 2025This weekend, I gave a talk in BangPypers based on the content of the first two articles in this blog related to the memory footprint of Python objects and the optmization of the same.
After the talk, during the interactive sessions, an engineer asked me a very interestng question:
"Doesn't …
Taming memory of Python objects - slots and weak references
by Anand, post on Tue 07 October 2025In the last article, I took an example of a simple Python class and using it to demo how dynamic the actual memory footprint of a Python object is and how deceptively large it can be.
The hidden cost of __dict__
Let me continue with our Person class to refresh …
The memory footprint of Python objects
by Anand, post on Wed 01 October 2025Background
Of late, I was exploring Python again after a while and looking at how classes and instances keep state. Let us look at a simple example of a Python class.
class Person:
def __init__(self, name, age, gender):
self.name = name
self.age = age
self.gender = gender
Let me …