Leia a versão em português deste artigo aqui.

1. Introduction

Ever wondered why modifying a list inside a function changes the original list, but modifying a number doesn't? You've just run into one of the most fundamental — and most misunderstood — concepts in Python: its data model.

Understanding how Python represents, identifies, and compares objects isn't just theory: it's what saves you from subtle bugs related to aliasing, incorrect comparisons, and unexpected side effects in mutable containers.

In this first article of the series, we'll build the foundation you need for that: what an object actually is in Python, the difference between identity and equality, what mutability really means, how an object is born and dies, and how all of this connects once objects live inside containers.