exception objects so fari've been deliberately vague about what an exception actually is as suggested in the prior as of python and both built-in and user-defined exceptions are identified by class instance objects this is what is raised and propagated along by exception processingand the source of the class matched against exceptions named in try statements although this means you must use object-oriented programming to define new exceptions in your programs--and introduces knowledge dependency that deferred full exception coverage to this part of the book--basing exceptions on classes and oop offers number of benefits among themclass-based exceptionscan be organized into categories exceptions coded as classes support future changes by providing categories--adding new exceptions in the future won' generally require changes in try statements have state information and behavior exception classes provide natural place for us to store context information and tools for use in the try handler--instances have access to both attached state information and callable methods support inheritance class-based exceptions can participate in inheritance hierarchies to obtain and customize common behavior--inherited display methodsfor examplecan provide common look and feel for error messages because of these advantagesclass-based exceptions support program evolution and larger systems well as we'll findall built-in exceptions are identified by classes and are organized into an inheritance treefor the reasons just listed you can do the same with user-defined exceptions of your own in factin python the built-in exceptions we'll study here turn out to be integral to new exceptions you define because requires user-defined exceptions to inherit from built-in exception superclasses that provide useful defaults for printing and state retentionthe task of coding user-defined exceptions also involves understanding the roles of these built-ins