traceback (most recent call last)file ""line in syntaxerrornone code like the following would similarly display three exceptionsthough implicitly triggered heretrytry exceptbadname exceptopen('nonesuch'like the unified trychained exceptions are similar to utility in other languages (including java and #though it' not clear which languages were borrowers in pythonit' still somewhat obscure extensionso we'll defer to python' manuals for more details in factpython adds way to stop exceptions from chainingper the following note python chained exception suppressionraise from none python introduces new syntax form--using none as the exception name in the raise from statementraise newexception from none this allows the display of the chained exception context described in the preceding section to be disabled this makes for less cluttered error messages in applications that convert between exception types while processing exception chains the assert statement as somewhat special case for debugging purposespython includes the assert statement it is mostly just syntactic shorthand for common raise usage patternand an assert can be thought of as conditional raise statement statement of the formassert testdata the data part is optional works like the following codeif __debug__if not testraise assertionerror(datain other wordsif the test evaluates to falsepython raises an exceptionthe data item (if it' providedis used as the exception' constructor argument like all exceptionsthe assertionerror exception will kill your program if it' not caught with tryin which case the data item shows up as part of the standard error message exception coding details