let' look at an example to see how class exceptions translate to code in the following fileclassexc pywe define superclass called general and two subclasses called spe cific and specific this example illustrates the notion of exception categories-general is category nameand its two subclasses are specific types of exceptions within the category handlers that catch general will also catch any subclasses of itincluding specific and specific class general(exception)pass class specific (general)pass class specific (general)pass def raiser () general(raise raise superclass instance def raiser () specific (raise raise subclass instance def raiser () specific (raise raise different subclass instance for func in (raiser raiser raiser )tryfunc(except generalmatch general or any subclass of it import sys print('caught%ssys exc_info()[ ] :\codepython classexc py caughtcaughtcaughtthis code is mostly straightforwardbut here are few points to noticeexception superclass classes used to build exception category trees have very few requirements--in factin this example they are mostly emptywith bodies that do nothing but pass noticethoughhow the top-level class here inherits from the built-in exception class this is required in python xpython allows standalone classic classes to serve as exceptions toobut it requires new-style classes to be derived from built-in exception classes just as in although we don' employ it herebecause excep tion provides some useful behavior we'll meet laterit' good idea to inherit from it in either python raising instances in this codewe call classes to make instances for the raise statements in the class exception modelwe always raise and catch class instance object if we list class exception objects