The raise statement allows the programmer to force a specified exception to occur. For example:
The sole argument to raise indicates the exception to be raised. This must be either an exception instance or an exception class (a class that derives from Exception).
8. Errors and Exceptions — Python v2.7.1 documentation
http://docs.python.org/tutorial/errors.html#raising-exceptions
沒有留言:
張貼留言