FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

More two-argument raise cleanup in the tutorial. · python/cpython@c7526f5 · GitHub

Repository navigation

Commit c7526f5

Browse files
committed
More two-argument raise cleanup in the tutorial.
1 parent 1fc035f commit c7526f5

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎Doc/tutorial/errors.rst‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,9 @@ exception to occur. For example::
221221
File "<stdin>", line 1, in ?
222222
NameError: HiThere
223223

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`).
228227

229228
If you need to determine whether an exception was raised but don't intend to
230229
handle it, a simpler form of the :keyword:`raise` statement allows you to

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL