(classes and built-in types work the same as you can seein classes are typesbut types are also classes technicallyeach class is generated by metaclass-- class that is normally either type itselfor subclass of it customized to augment or manage generated classes besides impacting code that does type testingthis turns out to be an important hook for tool developers we'll talk more about metaclasses later in this and again in more detail in implications for type testing besides providing for built-in type customization and metaclass hooksthe merging of classes and types in the new-style class model can impact code that does type testing in python xfor examplethe types of class instances compare directly and meaningfullyand in the same way as built-in type objects this follows from the fact that classes are now typesand an instance' type is the instance' classc:\codec:\python \python class cpass class dpass cd () (type( =type(dfalse xcompares the instancesclasses type( )type( ( __class__d __class__ ( () (type( =type( true with classic classes in xthoughcomparing instance types is almost uselessbecause all instances have the same "instancetype to truly compare typesthe instance __class__ attributes must be compared (if you care about portabilitythis works in xtoobut it' not required there) :\codec:\python \python class cpass class dpass cd () (type( =type(dtrue __class__ = __class__ false xall instances are same typecompare classes explicitly if needed type( )type( ( __class__d __class__ ( advanced class topics