summaryrefslogtreecommitdiffstats
path: root/Doc/ref6.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-02-07 14:37:17 (GMT)
committerGuido van Rossum <guido@python.org>1995-02-07 14:37:17 (GMT)
commiteb8b0d20c116766cb5a1aae275177c02526c5fd4 (patch)
treef4db62fce30b2e993bd26d8602fadbe144f4bbdb /Doc/ref6.tex
parent626c1e7882841777615345c5df7b6d3a44554d08 (diff)
downloadcpython-eb8b0d20c116766cb5a1aae275177c02526c5fd4.zip
cpython-eb8b0d20c116766cb5a1aae275177c02526c5fd4.tar.gz
cpython-eb8b0d20c116766cb5a1aae275177c02526c5fd4.tar.bz2
added classes as exceptions
Diffstat (limited to 'Doc/ref6.tex')
-rw-r--r--Doc/ref6.tex15
1 files changed, 11 insertions, 4 deletions
diff --git a/Doc/ref6.tex b/Doc/ref6.tex
index 70e1a68..f0f318f 100644
--- a/Doc/ref6.tex
+++ b/Doc/ref6.tex
@@ -324,13 +324,20 @@ raise_stmt: "raise" condition ["," condition]
\end{verbatim}
\verb@raise@ evaluates its first condition, which must yield
-a string object. If there is a second condition, this is evaluated,
-else \verb@None@ is substituted.
+a string, class, or instance object. If there is a second condition,
+this is evaluated, else \verb@None@ is substituted. If the first
+condition is a class object, then the second condition must be an
+instance of that class or one of its derivatives. If the first
+condition is an instance object, the second condition must be
+\verb@None@.
\index{exception}
\indexii{raising}{exception}
-It then raises the exception identified by the first object,
-with the second one (or \verb@None@) as its parameter.
+If the first object is a class or string, it then raises the exception
+identified by the first object, with the second one (or \verb@None@)
+as its parameter. If the first object is an instance, it raises the
+exception identified by the class of the object, with the instance as
+its parameter.
\section{The {\tt break} statement}
\stindex{break}