When defining a method on a class in Python, it looks something like this:
class MyClass(object): def __init__(self, x, y): self.x = x se
The 'self' parameter keeps the current calling object.
class class_name: class_variable def method_name(self,arg): self.var=arg obj=class_name() obj.method_name()
here, the self argument holds the object obj. Hence, the statement self.var denotes obj.var