[Python-checkins] CVS: python/dist/src/Doc/lib libexcs.tex,1.40,1.41
Fred L. Drake
fdrake@users.sourceforge.net
Fri, 21 Sep 2001 14:12:32 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv19370/lib
Modified Files:
libexcs.tex
Log Message:
Added reference to Tutorial section on user-defined exceptions for
information on defining new exceptions.
This closes SF bug #443559.
Index: libexcs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libexcs.tex,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** libexcs.tex 2001/07/26 13:41:05 1.40
--- libexcs.tex 2001/09/21 21:12:30 1.41
***************
*** 11,15 ****
The exceptions are defined in the module \module{exceptions}. This
module never needs to be imported explicitly: the exceptions are
! provided in the built-in namespace.
Two distinct string objects with the same value are considered different
--- 11,16 ----
The exceptions are defined in the module \module{exceptions}. This
module never needs to be imported explicitly: the exceptions are
! provided in the built-in namespace as well as the \module{exceptions}
! module.
Two distinct string objects with the same value are considered different
***************
*** 48,51 ****
--- 49,59 ----
inappropriate error.
+ The built-in exception classes can be sub-classed to define new
+ exceptions; programmers are encouraged to at least derive new
+ exceptions from the \exception{Exception} base class. More
+ information on defining exceptions is available in the
+ \citetitle[../tut/tut.html]{Python Tutorial} under the heading
+ ``User-defined Exceptions.''
+
\setindexsubitem{(built-in exception base class)}
***************
*** 255,264 ****
interactively).
! When class exceptions are used, instances of this class have
! atttributes \member{filename}, \member{lineno}, \member{offset} and
! \member{text} for easier access to the details; for string exceptions,
! the associated value is usually a tuple of the form
! \code{(message, (filename, lineno, offset, text))}.
! For class exceptions, \function{str()} returns only the message.
\end{excdesc}
--- 263,270 ----
interactively).
! Instances of this class have atttributes \member{filename},
! \member{lineno}, \member{offset} and \member{text} for easier access
! to the details. \function{str()} of the exception instance returns
! only the message.
\end{excdesc}
***************
*** 270,274 ****
You should report this to the author or maintainer of your Python
! interpreter. Be sure to report the version string of the Python
interpreter (\code{sys.version}; it is also printed at the start of an
interactive Python session), the exact error message (the exception's
--- 276,280 ----
You should report this to the author or maintainer of your Python
! interpreter. Be sure to report the version of the Python
interpreter (\code{sys.version}; it is also printed at the start of an
interactive Python session), the exact error message (the exception's
***************
*** 343,347 ****
! \setindexsubitem{(built-in warning category)}
The following exceptions are used as warning categories; see the
--- 349,353 ----
! \setindexsubitem{(built-in warning)}
The following exceptions are used as warning categories; see the