exceptions
index
(built-in)

Python's standard exception class hierarchy.
 
Before Python 1.5, the standard exceptions were all simple string objects.
In Python 1.5, the standard exceptions were converted to classes organized
into a relatively flat hierarchy.  String-based standard exceptions were
optional, or used as a fallback if some problem occurred while importing
the exception module.  With Python 1.6, optional string-based standard
exceptions were removed (along with the -X command line flag).
 
The class exceptions were implemented in such a way as to be almost
completely backward compatible.  Some tricky uses of IOError could
potentially have broken, but by Python 1.6, all of these should have
been fixed.  As of Python 1.6, the class-based standard exceptions are
now implemented in C, and are guaranteed to exist in the Python
interpreter.
 
Here is a rundown of the class hierarchy.  The classes found here are
inserted into both the exceptions module and the `built-in' module.  It is
recommended that user defined class based exceptions be derived from the
`Exception' class, although this is currently not enforced.
 
Exception
 |
 +-- SystemExit
 +-- 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
 |    |
 |    +-- SystemError
 |    +-- MemoryError
 |
 +---Warning
      |
      +-- UserWarning
      +-- DeprecationWarning
      +-- SyntaxWarning
      +-- RuntimeWarning

 
Classes
            
Exception
StandardError
ArithmeticError
FloatingPointError
OverflowError
ZeroDivisionError
AssertionError
AttributeError
EOFError
EnvironmentError
IOError
OSError
ImportError
KeyboardInterrupt
LookupError
IndexError
KeyError
MemoryError
NameError
UnboundLocalError
RuntimeError
NotImplementedError
SyntaxError
IndentationError
TabError
SystemError
TypeError
ValueError
UnicodeError
SystemExit
Warning
DeprecationWarning
RuntimeWarning
SyntaxWarning
UserWarning

 
class ArithmeticError
      Base class for arithmetic errors.
 
  

 
class AssertionError
      Assertion failed.
 
  

 
class AttributeError
      Attribute not found.
 
  

 
class DeprecationWarning
      Base class for warnings about deprecated features.
 
  

 
class EOFError
      Read beyond end of file.
 
  

 
class EnvironmentError
      Base class for I/O related errors.
 
  
__init__(...)
__str__(...)

 
class Exception
      Common base class for all exceptions.
 
  
__getitem__(...)
__init__(...)
__str__(...)

 
class FloatingPointError
      Floating point operation failed.
 
  

 
class IOError
      I/O operation failed.
 
  

 
class ImportError
      Import can't find module, or can't find name in module.
 
  

 
class IndentationError
      Improper indentation.
 
  

 
class IndexError
      Sequence index out of range.
 
  

 
class KeyError
      Mapping key not found.
 
  

 
class KeyboardInterrupt
      Program interrupted by user.
 
  

 
class LookupError
      Base class for lookup errors.
 
  

 
class MemoryError
      Out of memory.
 
  

 
class NameError
      Name not found globally.
 
  

 
class NotImplementedError
      Method or function hasn't been implemented yet.
 
  

 
class OSError
      OS system call failed.
 
  

 
class OverflowError
      Result too large to be represented.
 
  

 
class RuntimeError
      Unspecified run-time error.
 
  

 
class RuntimeWarning
      Base class for warnings about dubious runtime behavior.
 
  

 
class StandardError
      Base class for all standard Python exceptions.
 
  

 
class SyntaxError
      Invalid syntax.
 
  
__init__(...)
__str__(...)

 
class SyntaxWarning
      Base class for warnings about dubious syntax.
 
  

 
class SystemError
      Internal error in the Python interpreter.
 
Please report this to the Python maintainer, along with the traceback,
the Python version, and the hardware/OS platform and version.
 
  

 
class SystemExit
      Request to exit from the interpreter.
 
  
__init__(...)

 
class TabError
      Improper mixture of spaces and tabs.
 
  

 
class TypeError
      Inappropriate argument type.
 
  

 
class UnboundLocalError
      Local name referenced but not bound to a value.
 
  

 
class UnicodeError
      Unicode related error.
 
  

 
class UserWarning
      Base class for warnings generated by user code.
 
  

 
class ValueError
      Inappropriate argument value (of correct type).
 
  

 
class Warning
      Base class for warning categories.
 
  

 
class ZeroDivisionError
      Second argument to a division or modulo operation was zero.
 
  

 
Data
             __name__ = 'exceptions'