exception coding details in the prior we took quick look at exception-related statements in action herewe're going to dig bit deeper--this provides more formal introduction to exception processing syntax in python specificallywe'll explore the details behind the tryraiseassertand with statements as we'll seealthough these statements are mostly straightforwardthey offer powerful tools for dealing with exceptional conditions in python code one procedural note up frontthe exception story has changed in major ways in recent years as of python the finally clause can appear in the same try statement as except and else clauses (previouslythey could not be combinedalsoas of python and the new with context manager statement has become officialand user-defined exceptions must now be coded as class instanceswhich should inherit from built-in exception superclass moreover sports slightly modified syntax for the raise statement and except clausessome of which is available in and will focus on the state of exceptions in recent python and releases in this editionbut because you are still very likely to see the original techniques in code for some time to comealong the way 'll point out how things have evolved in this domain the try/except/else statement now that we've seen the basicsit' time for the details in the following discussioni'll first present try/except/else and try/finally as separate statementsbecause in versions of python prior to they serve distinct roles and cannot be combinedand still are at least logically distinct today per the preceding notein python and later except and finally can be mixed in single try statementwe'll see the implications of that merging after we've explored the two original forms in isolation