my little 2 cents
In this class Person, we defined out init method with the self and interesting thing to notice here is the memory location of both the self and instance variable p is same <__main__.Person object at 0x106a78fd0>
class Person: def __init__(self, name, age): self.name = name self.age = age def say_hi(self): print("the self is at:", self) print((f"hey there, my name is {self.name} and I am {self.age} years old")) def say_bye(self): print("the self is at:", self) print(f"good to see you {self.name}")p = Person("john", 78)print("the p is at",p)p.say_hi() p.say_bye()
so as explained in above, both self and instance variable are same object.