MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //usr/share/doc/python-docs-2.4.3/html/lib/module-exceptions.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index' />
<link rel="first" href="lib.html" title='Python Library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node35.html" />
<link rel="prev" href="types.html" />
<link rel="parent" href="builtin.html" />
<link rel="next" href="node35.html" />
<meta name='aesop' content='information' />
<title>2.4 Built-in Exceptions</title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="2.3.11 Special Attributes"
  href="specialattrs.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="2. Built-In Objects"
  href="builtin.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="2.5 Built-in Constants"
  href="node35.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="specialattrs.html">2.3.11 Special Attributes</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="builtin.html">2. Built-In Objects</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node35.html">2.5 Built-in Constants</A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION004400000000000000000">
2.4 Built-in Exceptions</A>
</H1>

<P>
<A NAME="module-exceptions"></A>

<P>
Exceptions should be class objects.  
The exceptions are defined in the module <tt class="module">exceptions</tt>.  This
module never needs to be imported explicitly: the exceptions are
provided in the built-in namespace as well as the <tt class="module">exceptions</tt>
module.

<P>
<div class="note"><b class="label">Note:</b>
In past versions of Python string exceptions were supported.  In
Python 1.5 and newer versions, all standard exceptions have been
converted to class objects and users are encouraged to do the same.
String exceptions will raise a <code>PendingDeprecationWarning</code>.
In future versions, support for string exceptions will be removed.

<P>
Two distinct string objects with the same value are considered different
exceptions.  This is done to force programmers to use exception names
rather than their string value when specifying exception handlers.
The string value of all built-in exceptions is their name, but this is
not a requirement for user-defined exceptions or exceptions defined by
library modules.
</div>

<P>
For class exceptions, in a <tt class="keyword">try</tt><a id='l2h-278' xml:id='l2h-278'></a> statement with
an <tt class="keyword">except</tt><a id='l2h-279' xml:id='l2h-279'></a> clause that mentions a particular
class, that clause also handles any exception classes derived from
that class (but not exception classes from which <em>it</em> is
derived).  Two exception classes that are not related via subclassing
are never equivalent, even if they have the same name.

<P>
The built-in exceptions listed below can be generated by the
interpreter or built-in functions.  Except where mentioned, they have
an ``associated value'' indicating the detailed cause of the error.
This may be a string or a tuple containing several items of
information (e.g., an error code and a string explaining the code).
The associated value is the second argument to the
<tt class="keyword">raise</tt><a id='l2h-280' xml:id='l2h-280'></a> statement.  For string exceptions, the
associated value itself will be stored in the variable named as the
second argument of the <tt class="keyword">except</tt> clause (if any).  For class
exceptions, that variable receives the exception instance.  If the
exception class is derived from the standard root class
<tt class="exception">Exception</tt>, the associated value is present as the
exception instance's <tt class="member">args</tt> attribute, and possibly on other
attributes as well.

<P>
User code can raise built-in exceptions.  This can be used to test an
exception handler or to report an error condition ``just like'' the
situation in which the interpreter raises the same exception; but
beware that there is nothing to prevent user code from raising an
inappropriate error.

<P>
The built-in exception classes can be sub-classed to define new
exceptions; programmers are encouraged to at least derive new
exceptions from the <tt class="exception">Exception</tt> base class.  More
information on defining exceptions is available in the
<em class="citetitle"><a
 href="../tut/tut.html"
 title="Python Tutorial"
 >Python Tutorial</a></em> under the heading
``User-defined Exceptions.''

<P>

<P>
The following exceptions are only used as base classes for other
exceptions.

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-281' xml:id='l2h-281' class="exception">Exception</tt></b></dt>
<dd>
The root class for exceptions.  All built-in exceptions are derived
from this class.  All user-defined exceptions should also be derived
from this class, but this is not (yet) enforced.  The <tt class="function">str()</tt>
function, when applied to an instance of this class (or most derived
classes) returns the string value of the argument or arguments, or an
empty string if no arguments were given to the constructor.  When used
as a sequence, this accesses the arguments given to the constructor
(handy for backward compatibility with old code).  The arguments are
also available on the instance's <tt class="member">args</tt> attribute, as a tuple.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-282' xml:id='l2h-282' class="exception">StandardError</tt></b></dt>
<dd>
The base class for all built-in exceptions except
<tt class="exception">StopIteration</tt> and <tt class="exception">SystemExit</tt>.
<tt class="exception">StandardError</tt> itself is derived from the root class
<tt class="exception">Exception</tt>.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-283' xml:id='l2h-283' class="exception">ArithmeticError</tt></b></dt>
<dd>
The base class for those built-in exceptions that are raised for
various arithmetic errors: <tt class="exception">OverflowError</tt>,
<tt class="exception">ZeroDivisionError</tt>, <tt class="exception">FloatingPointError</tt>.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-284' xml:id='l2h-284' class="exception">LookupError</tt></b></dt>
<dd>
The base class for the exceptions that are raised when a key or
index used on a mapping or sequence is invalid: <tt class="exception">IndexError</tt>,
<tt class="exception">KeyError</tt>.  This can be raised directly by
<tt class="function">sys.setdefaultencoding()</tt>.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-285' xml:id='l2h-285' class="exception">EnvironmentError</tt></b></dt>
<dd>
The base class for exceptions that
can occur outside the Python system: <tt class="exception">IOError</tt>,
<tt class="exception">OSError</tt>.  When exceptions of this type are created with a
2-tuple, the first item is available on the instance's <tt class="member">errno</tt>
attribute (it is assumed to be an error number), and the second item
is available on the <tt class="member">strerror</tt> attribute (it is usually the
associated error message).  The tuple itself is also available on the
<tt class="member">args</tt> attribute.

<span class="versionnote">New in version 1.5.2.</span>

<P>
When an <tt class="exception">EnvironmentError</tt> exception is instantiated with a
3-tuple, the first two items are available as above, while the third
item is available on the <tt class="member">filename</tt> attribute.  However, for
backwards compatibility, the <tt class="member">args</tt> attribute contains only a
2-tuple of the first two constructor arguments.

<P>
The <tt class="member">filename</tt> attribute is <code>None</code> when this exception is
created with other than 3 arguments.  The <tt class="member">errno</tt> and
<tt class="member">strerror</tt> attributes are also <code>None</code> when the instance was
created with other than 2 or 3 arguments.  In this last case,
<tt class="member">args</tt> contains the verbatim constructor arguments as a tuple.
</dd></dl>

<P>

<P>
The following exceptions are the exceptions that are actually raised.

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-286' xml:id='l2h-286' class="exception">AssertionError</tt></b></dt>
<dd>
<a id='l2h-287' xml:id='l2h-287'></a>Raised when an <tt class="keyword">assert</tt> statement fails.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-288' xml:id='l2h-288' class="exception">AttributeError</tt></b></dt>
<dd>
Raised when an attribute reference or assignment fails.  (When an
  object does not support attribute references or attribute assignments
  at all, <tt class="exception">TypeError</tt> is raised.)
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-289' xml:id='l2h-289' class="exception">EOFError</tt></b></dt>
<dd>
Raised when one of the built-in functions (<tt class="function">input()</tt> or
  <tt class="function">raw_input()</tt>) hits an end-of-file condition (EOF) without
  reading any data.
(N.B.: the <tt class="method">read()</tt> and <tt class="method">readline()</tt> methods of file
  objects return an empty string when they hit EOF.)
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-290' xml:id='l2h-290' class="exception">FloatingPointError</tt></b></dt>
<dd>
  Raised when a floating point operation fails.  This exception is
  always defined, but can only be raised when Python is configured
  with the <b class="programopt">--with-fpectl</b> option, or the
  <tt class="constant">WANT_SIGFPE_HANDLER</tt> symbol is defined in the
  <span class="file">pyconfig.h</span> file.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-291' xml:id='l2h-291' class="exception">IOError</tt></b></dt>
<dd>
Raised when an I/O operation (such as a <tt class="keyword">print</tt> statement,
  the built-in <tt class="function">open()</tt> function or a method of a file
  object) fails for an I/O-related reason, e.g., ``file not found'' or
  ``disk full''.

<P>
This class is derived from <tt class="exception">EnvironmentError</tt>.  See the
  discussion above for more information on exception instance
  attributes.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-292' xml:id='l2h-292' class="exception">ImportError</tt></b></dt>
<dd>
Raised when an <tt class="keyword">import</tt> statement fails to find the module
  definition or when a <code>from  ... import</code> fails to find a
  name that is to be imported.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-293' xml:id='l2h-293' class="exception">IndexError</tt></b></dt>
<dd>
Raised when a sequence subscript is out of range.  (Slice indices are
  silently truncated to fall in the allowed range; if an index is not a
  plain integer, <tt class="exception">TypeError</tt> is raised.)
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-294' xml:id='l2h-294' class="exception">KeyError</tt></b></dt>
<dd>
Raised when a mapping (dictionary) key is not found in the set of
  existing keys.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-295' xml:id='l2h-295' class="exception">KeyboardInterrupt</tt></b></dt>
<dd>
  Raised when the user hits the interrupt key (normally
  <kbd>Control-C</kbd> or <kbd>Delete</kbd>).  During execution, a check for
  interrupts is made regularly.
Interrupts typed when a built-in function <tt class="function">input()</tt> or
  <tt class="function">raw_input()</tt> is waiting for input also raise this
  exception.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-296' xml:id='l2h-296' class="exception">MemoryError</tt></b></dt>
<dd>
  Raised when an operation runs out of memory but the situation may
  still be rescued (by deleting some objects).  The associated value is
  a string indicating what kind of (internal) operation ran out of memory.
  Note that because of the underlying memory management architecture
  (C's <tt class="cfunction">malloc()</tt> 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
  printed, in case a run-away program was the cause.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-297' xml:id='l2h-297' class="exception">NameError</tt></b></dt>
<dd>
  Raised when a local or global name is not found.  This applies only
  to unqualified names.  The associated value is an error message that
  includes the name that could not be found.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-298' xml:id='l2h-298' class="exception">NotImplementedError</tt></b></dt>
<dd>
  This exception is derived from <tt class="exception">RuntimeError</tt>.  In user
  defined base classes, abstract methods should raise this exception
  when they require derived classes to override the method.
  
<span class="versionnote">New in version 1.5.2.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-299' xml:id='l2h-299' class="exception">OSError</tt></b></dt>
<dd>
  This class is derived from <tt class="exception">EnvironmentError</tt> and is used
  primarily as the <tt class="module"><a href="module-os.html">os</a></tt> module's <code>os.error</code> exception.
  See <tt class="exception">EnvironmentError</tt> above for a description of the
  possible associated values.
  
<span class="versionnote">New in version 1.5.2.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-300' xml:id='l2h-300' class="exception">OverflowError</tt></b></dt>
<dd>
Raised when the result of an arithmetic operation is too large to be
  represented.  This cannot occur for long integers (which would rather
  raise <tt class="exception">MemoryError</tt> 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
  typical applications prefer to drop bits than raise an exception.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-301' xml:id='l2h-301' class="exception">ReferenceError</tt></b></dt>
<dd>
  This exception is raised when a weak reference proxy, created by the
  <tt class="function"><tt class="module"><a href="module-weakref.html">weakref</a></tt>.proxy()</tt> function, is used to access
  an attribute of the referent after it has been garbage collected.
  For more information on weak references, see the <tt class="module"><a href="module-weakref.html">weakref</a></tt>
  module.
  
<span class="versionnote">New in version 2.2:
Previously known as the
                <tt class="exception"><tt class="module"><a href="module-weakref.html">weakref</a></tt>.ReferenceError</tt>
                exception.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-302' xml:id='l2h-302' class="exception">RuntimeError</tt></b></dt>
<dd>
  Raised when an error is detected that doesn't fall in any of the
  other categories.  The associated value is a string indicating what
  precisely went wrong.  (This exception is mostly a relic from a
  previous version of the interpreter; it is not used very much any
  more.)
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-303' xml:id='l2h-303' class="exception">StopIteration</tt></b></dt>
<dd>
  Raised by an iterator's <tt class="method">next()</tt> method to signal that there
  are no further values.
  This is derived from <tt class="exception">Exception</tt> rather than
  <tt class="exception">StandardError</tt>, since this is not considered an error in
  its normal application.
  
<span class="versionnote">New in version 2.2.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-304' xml:id='l2h-304' class="exception">SyntaxError</tt></b></dt>
<dd>
Raised when the parser encounters a syntax error.  This may occur in
  an <tt class="keyword">import</tt> statement, in an <tt class="keyword">exec</tt> statement, in a call
  to the built-in function <tt class="function">eval()</tt> or <tt class="function">input()</tt>, or
  when reading the initial script or standard input (also
  interactively).

<P>
Instances of this class have attributes <tt class="member">filename</tt>,
  <tt class="member">lineno</tt>, <tt class="member">offset</tt> and <tt class="member">text</tt> for easier access
  to the details.  <tt class="function">str()</tt> of the exception instance returns
  only the message.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-305' xml:id='l2h-305' class="exception">SystemError</tt></b></dt>
<dd>
  Raised when the interpreter finds an internal error, but the
  situation does not look so serious to cause it to abandon all hope.
  The associated value is a string indicating what went wrong (in
  low-level terms).

<P>
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</code>; it is also printed at the start of an
  interactive Python session), the exact error message (the exception's
  associated value) and if possible the source of the program that
  triggered the error.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-306' xml:id='l2h-306' class="exception">SystemExit</tt></b></dt>
<dd>
This exception is raised by the <tt class="function">sys.exit()</tt> function.  When it
  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 <tt class="cfunction">exit()</tt> function); if it is
  <code>None</code>, 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.

<P>
Instances have an attribute <tt class="member">code</tt> which is set to the
  proposed exit status or error message (defaulting to <code>None</code>).
  Also, this exception derives directly from <tt class="exception">Exception</tt> and
  not <tt class="exception">StandardError</tt>, since it is not technically an error.

<P>
A call to <tt class="function">sys.exit()</tt> is translated into an exception so that
  clean-up handlers (<tt class="keyword">finally</tt> clauses of <tt class="keyword">try</tt> statements)
  can be executed, and so that a debugger can execute a script without
  running the risk of losing control.  The <tt class="function">os._exit()</tt> function
  can be used if it is absolutely positively necessary to exit
  immediately (for example, in the child process after a call to
  <tt class="function">fork()</tt>).
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-307' xml:id='l2h-307' class="exception">TypeError</tt></b></dt>
<dd>
  Raised when an operation or function is applied to an object
  of inappropriate type.  The associated value is a string giving
  details about the type mismatch.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-308' xml:id='l2h-308' class="exception">UnboundLocalError</tt></b></dt>
<dd>
  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 <tt class="exception">NameError</tt>.

<span class="versionnote">New in version 2.0.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-309' xml:id='l2h-309' class="exception">UnicodeError</tt></b></dt>
<dd>
  Raised when a Unicode-related encoding or decoding error occurs.  It
  is a subclass of <tt class="exception">ValueError</tt>.

<span class="versionnote">New in version 2.0.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-310' xml:id='l2h-310' class="exception">UnicodeEncodeError</tt></b></dt>
<dd>
  Raised when a Unicode-related error occurs during encoding.  It
  is a subclass of <tt class="exception">UnicodeError</tt>.

<span class="versionnote">New in version 2.3.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-311' xml:id='l2h-311' class="exception">UnicodeDecodeError</tt></b></dt>
<dd>
  Raised when a Unicode-related error occurs during decoding.  It
  is a subclass of <tt class="exception">UnicodeError</tt>.

<span class="versionnote">New in version 2.3.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-312' xml:id='l2h-312' class="exception">UnicodeTranslateError</tt></b></dt>
<dd>
  Raised when a Unicode-related error occurs during translating.  It
  is a subclass of <tt class="exception">UnicodeError</tt>.

<span class="versionnote">New in version 2.3.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-313' xml:id='l2h-313' class="exception">ValueError</tt></b></dt>
<dd>
  Raised when a built-in operation or function receives an argument
  that has the right type but an inappropriate value, and the
  situation is not described by a more precise exception such as
  <tt class="exception">IndexError</tt>.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-314' xml:id='l2h-314' class="exception">WindowsError</tt></b></dt>
<dd>
  Raised when a Windows-specific error occurs or when the error number
  does not correspond to an <tt class="cdata">errno</tt> value.  The
  <tt class="member">errno</tt> and <tt class="member">strerror</tt> values are created from the
  return values of the <tt class="cfunction">GetLastError()</tt> and
  <tt class="cfunction">FormatMessage()</tt> functions from the Windows Platform API.
  This is a subclass of <tt class="exception">OSError</tt>.

<span class="versionnote">New in version 2.0.</span>

</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-315' xml:id='l2h-315' class="exception">ZeroDivisionError</tt></b></dt>
<dd>
  Raised when the second argument of a division or modulo operation is
  zero.  The associated value is a string indicating the type of the
  operands and the operation.
</dd></dl>

<P>

<P>
The following exceptions are used as warning categories; see the
<tt class="module"><a href="module-warnings.html">warnings</a></tt> module for more information.

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-316' xml:id='l2h-316' class="exception">Warning</tt></b></dt>
<dd>
Base class for warning categories.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-317' xml:id='l2h-317' class="exception">UserWarning</tt></b></dt>
<dd>
Base class for warnings generated by user code.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-318' xml:id='l2h-318' class="exception">DeprecationWarning</tt></b></dt>
<dd>
Base class for warnings about deprecated features.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-319' xml:id='l2h-319' class="exception">PendingDeprecationWarning</tt></b></dt>
<dd>
Base class for warnings about features which will be deprecated in the future.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-320' xml:id='l2h-320' class="exception">SyntaxWarning</tt></b></dt>
<dd>
Base class for warnings about dubious syntax
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-321' xml:id='l2h-321' class="exception">RuntimeWarning</tt></b></dt>
<dd>
Base class for warnings about dubious runtime behavior.
</dd></dl>

<P>
<dl><dt><b><span class="typelabel">exception</span>&nbsp;<tt id='l2h-322' xml:id='l2h-322' class="exception">FutureWarning</tt></b></dt>
<dd>
Base class for warnings about constructs that will change semantically
in the future.
</dd></dl>

<P>
The class hierarchy for built-in exceptions is:

<P>
<div class="verbatim"><pre>
    Exception
     +-- SystemExit
     +-- StopIteration
     +-- StandardError
     |    +-- KeyboardInterrupt
     |    +-- ImportError
     |    +-- EnvironmentError
     |    |    +-- IOError
     |    |    +-- OSError
     |    |         +-- WindowsError
     |    +-- EOFError
     |    +-- RuntimeError
     |    |    +-- NotImplementedError
     |    +-- NameError
     |    |    +-- UnboundLocalError
     |    +-- AttributeError
     |    +-- SyntaxError
     |    |    +-- IndentationError
     |    |         +-- TabError
     |    +-- TypeError
     |    +-- AssertionError
     |    +-- LookupError
     |    |    +-- IndexError
     |    |    +-- KeyError
     |    +-- ArithmeticError
     |    |    +-- OverflowError
     |    |    +-- ZeroDivisionError
     |    |    +-- FloatingPointError
     |    +-- ValueError
     |    |    +-- UnicodeError
     |    |        +-- UnicodeEncodeError
     |    |        +-- UnicodeDecodeError
     |    |        +-- UnicodeTranslateError
     |    +-- ReferenceError
     |    +-- SystemError
     |    +-- MemoryError
     +---Warning
	  +-- UserWarning
	  +-- DeprecationWarning
	  +-- PendingDeprecationWarning
	  +-- SyntaxWarning
	  +-- OverflowWarning (not generated in 2.4; won't exist in 2.5)
	  +-- RuntimeWarning
	  +-- FutureWarning
</pre></div>

<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="2.3.11 Special Attributes"
  href="specialattrs.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="2. Built-In Objects"
  href="builtin.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="2.5 Built-in Constants"
  href="node35.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="specialattrs.html">2.3.11 Special Attributes</A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="builtin.html">2. Built-In Objects</A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node35.html">2.5 Built-in Constants</A>
</div>
</div>
<hr />
<span class="release-info">Release 2.4.3, documentation updated on 29 March 2006.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>