The reason you need to use self is because Python does not use special syntax to refer to instance attributes. Python decided to do methods in a way that makes the instance to which the method belongs be passed automatically but not received automatically, the first parameter of methods is the instance the method is called on. That makes methods entirely the same as functions and leaves the actual name to use up to you (although self is the convention, and people will generally frown at you when you use something else.) self is not special to the code, it's just another object.

Python could have done something else to distinguish normal names from attributes -- special syntax like Ruby has, or requiring declarations like C++ and Java do, or perhaps something yet more different -- but it didn't. Python's all for making things explicit, making it obvious what's what, and although it doesn't do it entirely everywhere, it does do it for instance attributes. That's why assigning to an instance attribute needs to know what instance to assign to, and that's why it needs self.

Answer from Thomas Wouters on Stack Overflow
🌐
W3Schools
w3schools.com › python › python_class_self.asp
Python self Parameter
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... The self parameter is a reference to the current instance of the class.
🌐
GeeksforGeeks
geeksforgeeks.org › python › self-in-python-class
self in Python class - GeeksforGeeks
January 23, 2026 - Explanation: In this example, self allows each instance to retain its unique attributes, such as model and color and the show() method displays them. Although self is not a Python keyword, using it is a widely accepted convention.
Discussions

python - What is the purpose of the `self` parameter? Why is it needed? - Stack Overflow
Python methods are not called in ... itself. self in Python may be used to deal with custom object models or something. ... It’s there to follow the Python zen “explicit is better than implicit”. It’s indeed a reference to your class object. In Java and PHP, for example, it's called ... More on stackoverflow.com
🌐 stackoverflow.com
Understanding classes, init and self
Could you explain this code excerpt? I am learning and trying to get in touch with the logic of classes · The __init__ method initialises a new instance (object) of the class NewWindow. The actual creation of the instance is done by a separate method __new__, before __init__ is called. More on discuss.python.org
🌐 discuss.python.org
19
0
February 16, 2024
Can Someone explain to me what is self and init in python?
watch this . More on reddit.com
🌐 r/learnpython
39
243
November 29, 2022
Python class __init__ and self
My question what do self an init mean in python class? like this: class Complex: def __init__(self, realpart, imagpart): self.r = realpart self.i = imagpart so why I have to do that? And what do that mean? More on discuss.python.org
🌐 discuss.python.org
7
0
October 4, 2024
🌐
W3Schools
w3schools.com › python › gloss_python_self.asp
Python Self
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... The self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class.
🌐
Programiz
programiz.com › article › python-self-why
self in Python, Demystified
class Point(object): def __init__(self,x = 0,y = 0): self.x = x self.y = y def distance(self): """Find distance from origin""" return (self.x**2 + self.y**2) ** 0.5 · Let us now instantiate this class and find the distance. ... In the above example, __init__() defines three parameters but we just passed two (6 and 8). Similarly distance() requires one but zero arguments were passed. Why is Python not complaining about this argument number mismatch?
🌐
Real Python
realpython.com › ref › glossary › self
self (argument) | Python Glossary – Real Python
This allows the method to modify the instance’s state and differentiate instance variables from local variables inside methods. While you must explicitly declare self in method definitions, Python automatically passes the instance to methods when you call them. Here’s an example demonstrating self in a class:
🌐
Python Morsels
pythonmorsels.com › what-is-self
Python's self - Python Morsels
December 28, 2020 - Python's self is really just a variable that points to the current instance of our class. Every method you define must accept self as its first argument.
Find elsewhere
🌐
Edureka
edureka.co › blog › self-in-python
Self in Python Class | What is the Use of Python Self?
December 5, 2024 - This is what goes on inside you when you tap into your self: Object creation: When you create an object from a class (e.g., my_car = Car()), Python configures the memory for that object. Calling a Method: This also applies to methods, calling the method on the object and passing it as the first argument to that method, then Python takes care of the rest of the objects, such as passing my_car in this example: my_car.start().
🌐
SATHEE
sathee.iitk.ac.in › home › article › miscellaneous › self in python- exploring its examples and significance
SATHEE: Self In Python- Exploring Its Examples And Significance
June 21, 2025 - This enables these methods to work with and manipulate the object’s data. In Python, you can access instance attributes using the dot notation, such as self.attribute_name. ... In the Circle class example, the calculate_area method can access the self.radius attribute to perform its calculations.
🌐
Python documentation
docs.python.org › 3 › tutorial › classes.html
9. Classes — Python 3.14.4 documentation
It is not necessary that the function ... example: # Function defined outside the class def f1(self, x, y): return min(x, x+y) class C: f = f1 def g(self): return 'hello world' h = g...
🌐
Enterprise DNA
blog.enterprisedna.co › what-is-self-in-python-real-world-examples
What is Self in Python: Real-World Examples – Master Data Skills + AI
In the example above, we use self to call the show_species method from within the show_info method. This enables us to display the bird’s species and color in a single call. Lastly, remember to use self when accessing instance attributes and calling class methods.
🌐
Python
pythonprogramminglanguage.com › python-self
Understanding self in Python - Python
The second call passes the object dog as hidden parameter (self). If you output cat.name or dog.name you’ll see the objects variables have been changed inside the class. If you are a Python beginner, then I highly recommend this book.
🌐
Reddit
reddit.com › r/learnpython › can someone explain to me what is self and init in python?
r/learnpython on Reddit: Can Someone explain to me what is self and init in python?
November 29, 2022 -

I tried learning OOP from many video tutorials and documentation but I'm not understanding why we really need it or what is the use of it.

So it would be really helpful if someone could explain to me like a child what is the need for self and init in python.

Also, If you could tell me how did you fully grasp the concept of OOP in Python that would be really beneficial to me.

Thank You.

🌐
Llego
llego.dev › home › blog › demystifying the self parameter: a complete guide to using self in python classes
Demystifying the self Parameter: A Complete Guide to Using self in Python Classes - llego.dev
July 11, 2023 - The examples showcase just a fraction of how self can be utilized for clean class design across domains like data science, games, networking, and more. To summarize proper usage of the self parameter in Python:
🌐
Educative
educative.io › answers › what-is-self-in-python
What is self in Python?
In this example, Python automatically passes self when calling example.example_method(10).
🌐
MicroPyramid
micropyramid.com › blog › understand-self-and-__init__-method-in-python-class
Understanding Self and __init__ Method in Python Class | MicroPyramid
r = Rectangle(160, 120, 2000) Note: "r" is the representation of the object outside of the class and "self" is the representation of the object inside the class. for more details please visit python documentation
🌐
AskPython
askpython.com › home › understanding python self variable with examples
Understanding Python self Variable with Examples - AskPython
September 5, 2019 - In most of the Object-Oriented ... having it as a method parameter. For example, we can use “this” keyword to access the current object in Java program....
🌐
Real Python
realpython.com › python-type-self
Python's Self Type: How to Annotate Methods That Return self – Real Python
June 10, 2023 - In particular, a method like .enqueue() would return Queue even if you called it on a subclass of Queue. Python’s Self type can handle these situations, offering a compact and readable annotation that takes care of the subtleties of annotating methods returning an instance of the enclosing class.