Foundations — `self` — what it is and how Python passes it
This page assumes nothing. Before we can even talk about self (that job belongs to the parent note, the parent topic), we must earn every word the parent leaned on: class, instance, attribute, method, argument, the dot ., binding. We build them one at a time, each one a picture.
1. Object — a labelled box that holds stuff
Picture it. Look at the figure: one box named alice. Inside are two drawers, owner and balance. The drawers are its own — no other box shares them.

Why the topic needs it. self will turn out to be one of these boxes. You cannot understand "the method works on self" until "an object is a box with its own drawers" is second nature.
2. Attribute — one named drawer inside the box
The dot here means "go inside this box and find the drawer called…". So alice.balance means "inside the box alice, the drawer labelled balance".
More depth on where these drawers live: Instance vs Class Attributes.
3. Class — the blueprint many boxes share
Picture it. The figure shows one blueprint sheet (Account) on the left, and two finished boxes (alice, bob) built from it on the right. Same plan, two separate boxes, each with its own drawer values.

Why the topic needs it. The whole reason self exists is that one blueprint is shared by many boxes. If each object had its own private copy of the code, there'd be no "which one?" question to answer. Foundation topic: Classes and Instances.
4. Instance — one actual box made from the blueprint
Class and instance are the two halves you must keep separate:
Blueprint (the plan)
AccountOne built box (has real values)
alice5. Function and argument — a machine you feed values into
Before "method", we need "function".
Picture it. The figure shows a machine deposit with two slots on its left labelled self and amount. You drop values into the slots; that filling-in is called binding (the parameter binds to the argument you passed).

Why the topic needs it. The parent's big reveal — alice.deposit(50) becomes Account.deposit(alice, 50) — is pure argument binding. If "first value fills first slot" is solid, that reveal is obvious rather than magic.
6. Method — a function that lives inside the blueprint
So a method is nothing new: it is a function (§5) stored inside a class (§3). The only special thing is a habit: its first parameter slot is reserved for the box itself, and by convention we name that slot self.
Deeper: Bound and Unbound Methods.
7. Binding via the dot — how the box gets into the first slot
Now assemble it. You write:
The dot (§2, "look inside alice") finds the deposit machine, and — here is the one new rule — it remembers alice and drops it into the first slot for you. The result is exactly:
Picture it. The figure shows the dot acting as a hand that grabs the box on its left and pushes it into the self slot before your other arguments arrive.

The machinery that makes the dot behave this way is the Descriptor Protocol; a first-slot-less cousin (cls, no first arg) shows up in classmethod and staticmethod.
Prerequisite map
Equipment checklist
An object is best pictured as…
Reading alice.balance out loud, the dot means…
A class differs from an instance because…
An argument is bound to a parameter by…
A method is really just…
When you write alice.deposit(50), the dot's special job is…
alice and drop it into the first parameter slot automatically.So alice.deposit(50) is equivalent to the explicit call…
Account.deposit(alice, 50).The single new idea self adds on top of all the above is…
self is just the name of that auto-filled first slot, holding the box that called the method.Connections
- Parent topic
- OOP Fundamentals
- Classes and Instances
- __init__ — the constructor
- Instance vs Class Attributes
- Bound and Unbound Methods
- Descriptor Protocol
- classmethod and staticmethod