Instance, Class & Static Methods
Part of the Python Roadmap
In short
Not every method needs an object. Some need the whole class, and some are just helpers that belong nearby. Python gives you three kinds of methods, and choosing the right one makes classes cleaner.
Instance methods work with one object through self, class methods (@classmethod) receive the class as cls and are often used as alternative constructors, and static methods (@staticmethod) are plain helpers grouped inside a class.

Think of it like this
Jobs in a restaurant
A waiter serves one specific table (instance method, works with self). The manager can open a new branch or create a 'combo meal' version of the menu (class method, works with the class itself). The wall clock just tells time for anyone and needs neither (static method).
Watch it happen
What each method receives
1/3account.deposit(500) passes the account as self, so it can change that one balance.
The big ideas
What you need to know
Instance methods
The default. They take self and read or change one object's data.
Class methods
Marked @classmethod, they take cls. Most often used as alternative constructors like from_dict or from_string.
Static methods
Marked @staticmethod, they take no automatic argument. Use them for small helpers related to the class.
cls respects subclasses
Because cls is whichever class you called it on, a class method in a parent builds the right child objects too.
See it in code
Walk through the code
1class Account:2 bank = "Bharat Bank"3 4 def __init__(self, owner: str, balance: float = 0):5 self.owner = owner6 self.balance = balance7 8 def deposit(self, amount: float) -> None: # instance9 self.balance += amount10 11 @classmethod12 def from_csv_row(cls, row: str) -> "Account": # class13 owner, balance = row.split(",")14 return cls(owner, float(balance))15 16 @staticmethod17 def is_valid_ifsc(code: str) -> bool: # static18 return len(code) == 11 and code[:4].isalpha() and code[4] == "0"19 20acc = Account.from_csv_row("Asha,1200")21acc.deposit(300)22print(acc.owner, acc.balance) # Asha 1500.023print(Account.is_valid_ifsc("SBIN0001234")) # True24print(Account.is_valid_ifsc("12345")) # False1/5An instance method changes this account's own balance.
A bank account with all three method types: deposit uses self, from_csv_row builds objects, is_valid_ifsc is a helper.
Save yourself the pain
Common mistakes
Oops
Making everything a @staticmethod and passing the object in by hand.
Do this instead
If a method needs the object's data, make it a normal instance method with self.
Oops
Hard-coding the class name inside a class method: return Account(...).
Do this instead
Return cls(...) so subclasses like SavingsAccount get objects of their own type.
Your mission
Temperature helpers
Quick check
Which method type is best for an alternative constructor like Date.from_string('2026-11-24')?
Go deeper
- 1Add a from_string() class method that builds an object from 'Riya,21'.
- 2Add a static method that validates a phone number.
- 3Decide which kind of method each of your methods should be.
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.