Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bbc9712

Browse files
committed
Update tutorial/classes.rst to remove references to the old two-argument form of the raise statement.
1 parent 0ec3477 commit bbc9712

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Doc/tutorial/classes.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,16 +586,16 @@ Exceptions Are Classes Too
586586
User-defined exceptions are identified by classes as well. Using this mechanism
587587
it is possible to create extensible hierarchies of exceptions.
588588

589-
There are two new valid (semantic) forms for the raise statement::
589+
There are two valid (semantic) forms for the raise statement::
590590

591-
raise Class, instance
591+
raise Class
592592

593-
raise instance
593+
raise Instance
594594

595-
In the first form, ``instance`` must be an instance of :class:`Class` or of a
596-
class derived from it. The second form is a shorthand for::
595+
In the first form, ``Class`` must be an instance of :class:`type` or of a
596+
class derived from it. The first form is a shorthand for::
597597

598-
raise instance.__class__, instance
598+
raise Class()
599599

600600
A class in an except clause is compatible with an exception if it is the same
601601
class or a base class thereof (but not the other way around --- an except clause

0 commit comments

Comments
 (0)