About 269,000 results
Open links in new tab
  1. self in Python class - GeeksforGeeks

    Jul 11, 2025 · What is the Purpose of "self"? In Python, self is used as the first parameter in instance methods to refer to the current object. It allows methods within the class to access …

  2. python - What is the purpose of the `self` parameter? Why is it …

    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 …

  3. Python Self - W3Schools

    The self parameter is a reference to the current instance of the class, and is used to access variables that belongs to the class. It does not have to be named self , you can call it whatever …

  4. self in Python, Demystified - Programiz

    The self keyword is used to represent an instance (object) of the given class. In this case, the two Cat objects cat1 and cat2 have their own name and age attributes. If there was no self …

  5. Python self Keyword - Tutorial Kart

    The self keyword is essential for defining instance variables and accessing other methods within a class. Without self, Python will not know which object’s attributes or methods to use.

  6. Mastering the `self` Keyword in Python — codegenes.net

    Jun 20, 2025 · The self keyword is a fundamental concept in Python’s object - oriented programming. It allows instance methods to access and modify the object’s attributes and call …

  7. Understanding the self Keyword in Python | Python tutorials on ...

    It appears in every method inside a class, and it’s essential to how Python handles objects and instances. This guide explains what self really means, why it’s necessary, and how to use it …

  8. Understanding "self" in Python Classes: A Complete Guide

    May 21, 2025 · You‘re not alone. The concept of "self" is fundamental to Python‘s object-oriented programming, yet it often trips up both beginners and experienced developers. In this …

  9. Understanding Python self Variable with Examples - AskPython

    Sep 5, 2019 · Python self is a keyword? Python self variable is not a reserved keyword. But, it’s the best practice and convention to use the variable name as “self” to refer to the instance.

  10. Python 'self' keyword - Stack Overflow

    First, Python's self is not a keyword, it's a coding convention, the same as Python's cls. Guido has written a really detailed and valuable article about the origin of Python's support for class, and …