@@ -366,19 +366,25 @@ \section{The \keyword{raise} statement\label{raise}}
366366Otherwose, \keyword {raise} evaluates its first expression, which must yield
367367a string, class, or instance object. If there is a second expression,
368368this is evaluated, else \code {None} is substituted. If the first
369- expression is a class object, then the second expression must be an
370- instance of that class or one of its derivatives. If the first
369+ expression is a class object, then the second expression may be an
370+ instance of that class or one of its derivatives, and then that
371+ instance is raised. If the second expression is not such an instance,
372+ the given class is instantiated. The argument list for the
373+ instantiation is determined as follows: if the second expression is a
374+ tuple, it is used as the argument list; if it is \code {None}, the
375+ argument list is empty; otherwise, the argument list consists of a
376+ single argument which is the second expression. If the first
371377expression is an instance object, the second expression must be
372378\code {None}.
373379\index {exception}
374380\indexii {raising}{exception}
375381
376- If the first object is a class or string, it then raises the exception
382+ If the first object is a string, it then raises the exception
377383identified by the first object, with the second one (or \code {None})
378- as its parameter. If the first object is an instance, it raises the
379- exception identified by the class of the object, with the instance as
380- its parameter (and there should be no second object, or the second
381- object should be \code {None}) .
384+ as its parameter. If the first object is a class or instance,
385+ it raises the exception identified by the class of the instance
386+ determined in the previous step, with the instance as
387+ its parameter .
382388
383389If a third object is present, and it is not \code {None}, it should be
384390a traceback object (see section \ref {traceback }), and it is
0 commit comments