tutorial,python tutorial 学习笔记(七)Errors and Exceptions

try, except, raise,finally

raise

raise NameError,’HiThere’ <==> raise NameError(‘HiThere’)
raise Class,instance
raise instance
raise can be used to re-raise the exception directly.

User-defined Exceptions:

Should be derived from the Exception class.
Tags: 

延伸阅读

最新评论

发表评论