__dict__ {' ' __module__ '__main__the __doc__ attribute is the doc string we definedwhile __module__ is the name of the module to which class belongswhich is simply __main__ in this casesince we defined it in the main program howeverthe most useful item is probably __dict__which is dictionary containing the names and values of all the attributes of the object any instance holds its attributes in the self __dict__ dictionarywhich is automatically created by python if we add new attributes to the instancethey are inserted into the __dict__a ([ , ]print __dict__ all attributes {' '[ ] myvar add new attribute (! __dict__ {'myvar' ' '[ ]when programming with classes we are not supposed to use the internal data structures such as __dict__ explicitlybut printing it to check the values of class attributes can be very useful if something goes wrong in our code exampleautomatic differentiation of functions to provide more relevant and useful example of __call__ special methodconsider the task of computing the derivative of an arbitrary function given some mathematical function in pythonsaydef ( )return ** we want to make class derivative and write dfdx derivative(fso that dfdx behaves as function that computes the derivative of (xwhen the instance dfdx is createdwe want to call it like regular function to evaluate the derivative of in point xprint(dfdx( )computes * ** for = it is tricky to create such class using analytical differentiation rulesbut we can write generic class by using numerical differentiation