at the top of the hierarchy creates specific typesand specific types create instances you can see this for yourself at the interactive prompt in python xfor examplethe type of list instance is the list classand the type of the list class is the type classc:\codepy - type([])type(type([])(type(list)type(type(in xlist instance is created from list class list class is created from type class samebut with type names type of type is typetop of hierarchy as we learned when studying new-style class changes in the same is generally true in python xbut types are not quite the same as classes--type is unique kind of built-in object that caps the type hierarchy and is used to construct typesc:\codepy - type([])type(type([])(type(list)type(type(in xtype is bit different as it happensthe type/instance relationship holds true for user-defined classes as wellinstances are created from classesand classes are created from type in python xthoughthe notion of "typeis merged with the notion of "class in factthe two are essentially synonyms--classes are typesand types are classes that istypes are defined by classes that derive from type user-defined classes are instances of type classes user-defined classes are types that generate instances of their own as we saw earlierthis equivalence affects code that tests the type of instancesthe type of an instance is the class from which it was generated it also has implications for the way that classes are created that turn out to be the key to this subject because classes are normally created from root type class by defaultmost programmers don' need to think about this type/class equivalence howeverit opens up new possibilities for customizing both classes and their instances for exampleall user-defined classes in (and new-style classes in xare instances of the type classand instance objects are instances of their classesin factclasses now have __class__ that links to typejust as an instance has __class__ that links to the class from which it was madec:\codepy - class cpass ( class object (new-styleclass instance object type(xx __class__ instance is instance of class type(cclass is instance of type instance' class the metaclass model