| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -221,10 +221,9 @@ exception to occur. For example:: | |||
| 221 | 221 | File "<stdin>", line 1, in ? | |
| 222 | 222 | NameError: HiThere | |
| 223 | 223 | ||
| 224 | - The first argument to :keyword:`raise` names the exception to be raised. The | ||
| 225 | - optional second argument specifies the exception's argument. Alternatively, the | ||
| 226 | - above could be written as ``raise NameError('HiThere')``. Either form works | ||
| 227 | - fine, but there seems to be a growing stylistic preference for the latter. | ||
| 224 | + The sole argument to :keyword:`raise` indicates the exception to be raised. | ||
| 225 | + This must be either an exception instance or an exception class (a class that | ||
| 226 | + derives from :class:`Exception`). | ||
| 228 | 227 | ||
| 229 | 228 | If you need to determine whether an exception was raised but don't intend to | |
| 230 | 229 | handle it, a simpler form of the :keyword:`raise` statement allows you to | |
| Back | FazBrowse Home | New Git URL |
0 commit comments