types and objects classes and instances as callables class objects and instances also operate as callable objects class object is created by the class statement and is called as function in order to create new instances in this casethe arguments to the function are passed to the _init_ (method of the class in order to initialize the newly created instance an instance can emulate function if it defines special method_ _call_ (if this method is defined for an instancexthen (argsinvokes the method _call_ (argsclassestypesand instances when you define classthe class definition normally produces an object of type type here' an exampleclass foo(object)pass type(foothe following table shows commonly used attributes of type object tattribute description _doc_ _name_ _bases_ _dict_ _module_ _abstractmethods_ documentation string class name tuple of base classes dictionary holding class methods and variables module name in which the class is defined set of abstract method names (may be undefined if there aren' anywhen an object instance is createdthe type of the instance is the class that defined it here' an examplef foo(type(fthe following table shows special attributes of an instance iattribute description _class_ _dict_ class to which the instance belongs dictionary holding instance data the _dict_ attribute is normally where all of the data associated with an instance is stored when you make assignments such as attr valuethe value is stored here howeverif user-defined class uses _slots_ _a more efficient internal representation is used and instances will not have _dict_ attribute more details on objects and the organization of the python object system can be found in modules the module type is container that holds objects loaded with the import statement when the statement import foo appears in programfor examplethe name foo is lib fl ff