__dict__ attribute in python - Stack Overflow What is self keyword used for in python? self represents the current instance of a class which is used to access the properties and methods of a class.