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(StandardError)
      Base class for arithmetic errors.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class AssertionError(StandardError)
      Assertion failed.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class AttributeError(StandardError)
      Attribute not found.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class DeprecationWarning(Warning)
      Base class for warnings about deprecated features.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class EOFError(StandardError)
      Read beyond end of file.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class EnvironmentError(StandardError)
      Base class for I/O related errors.
 
  
__getitem__(...) from Exception
__init__(...)
__str__(...)

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

 
class FloatingPointError(ArithmeticError)
      Floating point operation failed.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class IOError(EnvironmentError)
      I/O operation failed.
 
  
__getitem__(...) from Exception
__init__(...) from EnvironmentError
__str__(...) from EnvironmentError

 
class ImportError(StandardError)
      Import can't find module, or can't find name in module.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class IndentationError(SyntaxError)
      Improper indentation.
 
  
__getitem__(...) from Exception
__init__(...) from SyntaxError
__str__(...) from SyntaxError

 
class IndexError(LookupError)
      Sequence index out of range.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class KeyError(LookupError)
      Mapping key not found.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class KeyboardInterrupt(StandardError)
      Program interrupted by user.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class LookupError(StandardError)
      Base class for lookup errors.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class MemoryError(StandardError)
      Out of memory.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class NameError(StandardError)
      Name not found globally.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class NotImplementedError(RuntimeError)
      Method or function hasn't been implemented yet.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class OSError(EnvironmentError)
      OS system call failed.
 
  
__getitem__(...) from Exception
__init__(...) from EnvironmentError
__str__(...) from EnvironmentError

 
class OverflowError(ArithmeticError)
      Result too large to be represented.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class RuntimeError(StandardError)
      Unspecified run-time error.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class RuntimeWarning(Warning)
      Base class for warnings about dubious runtime behavior.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class StandardError(Exception)
      Base class for all standard Python exceptions.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class SyntaxError(StandardError)
      Invalid syntax.
 
  
__getitem__(...) from Exception
__init__(...)
__str__(...)

 
class SyntaxWarning(Warning)
      Base class for warnings about dubious syntax.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class SystemError(StandardError)
      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.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

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

 
class TabError(IndentationError)
      Improper mixture of spaces and tabs.
 
  
__getitem__(...) from Exception
__init__(...) from SyntaxError
__str__(...) from SyntaxError

 
class TypeError(StandardError)
      Inappropriate argument type.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class UnboundLocalError(NameError)
      Local name referenced but not bound to a value.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class UnicodeError(ValueError)
      Unicode related error.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class UserWarning(Warning)
      Base class for warnings generated by user code.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class ValueError(StandardError)
      Inappropriate argument value (of correct type).
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class Warning(Exception)
      Base class for warning categories.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
class ZeroDivisionError(ArithmeticError)
      Second argument to a division or modulo operation was zero.
 
  
__getitem__(...) from Exception
__init__(...) from Exception
__str__(...) from Exception

 
Data
             __name__ = 'exceptions'