Skip to content

2025

Inside CPython's attribute lookup

Python's attribute lookup logic seems pretty simple at a first glance: "first look in the instance __dict__, then look in its type".

However, the actual logic is much more complex because it needs to take into account the descriptor protocol, the difference between lookups on instances vs types, and what happens in presence of metaclasses.

Recently I implemented preliminary support for the descriptor protocol in SPy, which led me to investigate the CPython source code to get a better grasp on the details. This is a write up on what I found, with links to the actual C source code, to serve as a future reference.

Thanks to Hood Chatham, Siu Kwan Lam and Justin Wood for the feedback on drafts.

Claude code modified my .bashrc without asking?

Note

This is not the classical post about running claude in YOLO mode and then complaining that it damaged the system. I have reasons to think that claude automatically modified my .bashrc to remove a line alias claude=... without asking my permission and without notifying me of the change.

Tales with claude code: how to make it behave?

In the past weeks, I have been experimenting with using claude code to speed up development, in particular of SPy.

My experience so far reveals a clear pattern: claude excels at simple, one-shot tasks that follow existing patterns, producing commit-ready code. However, for complex tasks requiring multiple iterations, quality deteriorates significantly with each round, often necessitating complete rewrites or extensive cleanup.

Because of this, I have been looking for ways to guide it towards making it only simple steps, and to wait for my confirmation before going further. So far, I failed.

Over the clouds: CPython, Pyodide and SPy

The Python community is awesome.

It is full of great people and minds, and interacting with people at conferences is always nice and stimulating. But one of my favorite things is that over time, after many conferences, talks, pull requests and beers, the personal relationship with some of them strengthen and they become friends.

View from a ski slope in Valtournenche, Italy

I am fortunate enough that two of them, Ɓukasz Langa and Hood Chatham, accepted my invitation to join me in Cervinia, at the border between Italian and Swiss Alps, for a week of hacking, winter sports and going literally over the clouds. This is a brief summary of what we did during our time together.