[Python-checkins] CVS: python/dist/src/Doc/lib libexcs.tex,1.26,1.27
Fred Drake
python-dev@python.org
Thu, 6 Apr 2000 11:03:03 -0400
Update of /projects/cvsroot/python/dist/src/Doc/lib
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Doc/lib
Modified Files:
libexcs.tex
Log Message:
Revised / removed comments about string exceptions (relating to the
standard exceptions), added documentation of UnboundLocalError.
Index: libexcs.tex
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Doc/lib/libexcs.tex,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** libexcs.tex 2000/04/06 14:48:35 1.26
--- libexcs.tex 2000/04/06 15:03:01 1.27
***************
*** 50,56 ****
The following exceptions are only used as base classes for other
! exceptions. When string-based standard exceptions are used, they
! are tuples containing the directly derived classes.
! \strong{Note:} These will always be classes in Python 1.6.
\begin{excdesc}{Exception}
--- 50,54 ----
The following exceptions are only used as base classes for other
! exceptions.
\begin{excdesc}{Exception}
***************
*** 192,196 ****
a string indicating what kind of (internal) operation ran out of memory.
Note that because of the underlying memory management architecture
! (\C{}'s \cfunction{malloc()} function), the interpreter may not
always be able to completely recover from this situation; it
nevertheless raises an exception so that a stack traceback can be
--- 190,194 ----
a string indicating what kind of (internal) operation ran out of memory.
Note that because of the underlying memory management architecture
! (C's \cfunction{malloc()} function), the interpreter may not
always be able to completely recover from this situation; it
nevertheless raises an exception so that a stack traceback can be
***************
*** 225,229 ****
represented. This cannot occur for long integers (which would rather
raise \exception{MemoryError} than give up). Because of the lack of
! standardization of floating point exception handling in \C{}, most
floating point operations also aren't checked. For plain integers,
all operations that can overflow are checked except left shift, where
--- 223,227 ----
represented. This cannot occur for long integers (which would rather
raise \exception{MemoryError} than give up). Because of the lack of
! standardization of floating point exception handling in C, most
floating point operations also aren't checked. For plain integers,
all operations that can overflow are checked except left shift, where
***************
*** 274,287 ****
is not handled, the Python interpreter exits; no stack traceback is
printed. If the associated value is a plain integer, it specifies the
! system exit status (passed to \C{}'s \cfunction{exit()} function); if it is
\code{None}, the exit status is zero; if it has another type (such as
a string), the object's value is printed and the exit status is one.
! When class exceptions are used, the instance has an attribute
! \member{code} which is set to the proposed exit status or error message
! (defaulting to \code{None}). Also, this exception derives directly
! from \exception{Exception} and not \exception{StandardError}, since it
! is not technically an error.
!
A call to \function{sys.exit()} is translated into an exception so that
clean-up handlers (\keyword{finally} clauses of \keyword{try} statements)
--- 272,284 ----
is not handled, the Python interpreter exits; no stack traceback is
printed. If the associated value is a plain integer, it specifies the
! system exit status (passed to C's \cfunction{exit()} function); if it is
\code{None}, the exit status is zero; if it has another type (such as
a string), the object's value is printed and the exit status is one.
! Instances have an attribute \member{code} which is set to the
! proposed exit status or error message (defaulting to \code{None}).
! Also, this exception derives directly from \exception{Exception} and
! not \exception{StandardError}, since it is not technically an error.
!
A call to \function{sys.exit()} is translated into an exception so that
clean-up handlers (\keyword{finally} clauses of \keyword{try} statements)
***************
*** 298,304 ****
--- 295,309 ----
\end{excdesc}
+ \begin{excdesc}{UnboundLocalError}
+ Raised when a reference is made to a local variable in a function or
+ method, but no value has been bound to that variable. This is a
+ subclass of \exception{NameError}.
+ \versionadded{1.6}
+ \end{excdesc}
+
\begin{excdesc}{UnicodeError}
Raised when a Unicode-related encoding or decoding error occurs. It
is a subclass of \exception{ValueError}.
+ \versionadded{1.6}
\end{excdesc}