large if you've forgotten what __class__ means in an instanceand the prior for review of the as used here why exception hierarchiesbecause there are only three possible exceptions in the prior section' exampleit doesn' really do justice to the utility of class exceptions in factwe could achieve the same effects by coding list of exception names in parentheses within the except clausetryfunc(except (generalspecific specific )catch any of these this approach worked for the defunct string exception model too for large or high exception hierarchieshoweverit may be easier to catch categories using class-based categories than to list every member of category in single except clause perhaps more importantlyyou can extend exception hierarchies as software needs evolve by adding new subclasses without breaking existing code supposefor exampleyou code numeric programming library in pythonto be used by large number of people while you are writing your libraryyou identify two things that can go wrong with numbers in your code--division by zeroand numeric overflow you document these as the two standalone exceptions that your library may raisemathlib py class divzero(exception)pass class oflow(exception)pass def func()raise divzero(and so on nowwhen people use your librarythey typically wrap calls to your functions or classes in try statements that catch your two exceptionsafter allif they do not catch your exceptionsexceptions from your library will kill their codeclient py import mathlib trymathlib funcexcept (mathlib divzeromathlib oflow)handle and recover exception objects