What you are probably looking for is
'this is {0.a}'.format(self)
'this is {.a}'.format(self)
'this is {o.a}'.format(o=self)
'this is {self.a}'.format(self=self)
Please note, however, that you do not even have a mechod in your class.
Directly under the scope of the class there is no such thing as self.
source
share