exceptions
index
/usr/lib/python1.6/exceptions.py

Class based built-in exception hierarchy.
 
New with Python 1.5, all standard built-in exceptions are now class objects by
default.  This gives Python's exception handling mechanism a more
object-oriented feel.  Traditionally they were string objects.  Python will
fallback to string based exceptions if the interpreter is invoked with the -X
option, or if some failure occurs during class exception initialization (in
this case a warning will be printed).
 
Most existing code should continue to work with class based exceptions.  Some
tricky uses of IOError may break, but the most common uses should work.
 
Here is a rundown of the class hierarchy.  You can change this by editing this
file, but it isn't recommended because the old string based exceptions won't
be kept in sync.  The class names described here are expected to be found by
the bltinmodule.c file.  If you add classes here, you must modify
bltinmodule.c or the exceptions won't be available in the __builtin__ module,
nor will they be accessible from C.
 
The classes with a `*' are new since Python 1.5.  They are defined as tuples
containing the derived exceptions when string-based exceptions are used.  If
you define your own class based exceptions, they should be derived from
Exception.
 
Exception(*)
 |
 +-- SystemExit
 +-- StandardError(*)
      |
      +-- KeyboardInterrupt
      +-- ImportError
      +-- EnvironmentError(*)
      |    |
      |    +-- IOError
      |    +-- OSError(*)
      |         |
      |         +-- WindowsError(*)
      |
      +-- EOFError
      +-- RuntimeError
      |    |
      |    +-- NotImplementedError(*)
      |
      +-- NameError
      |    |
      |    +-- UnboundLocalError(*)
      |
      +-- AttributeError
      +-- SyntaxError
      +-- TypeError
      +-- AssertionError
      +-- LookupError(*)
      |    |
      |    +-- IndexError
      |    +-- KeyError
      |
      +-- ArithmeticError(*)
      |    |
      |    +-- OverflowError
      |    +-- ZeroDivisionError
      |    +-- FloatingPointError
      |
      +-- ValueError
      |    |
      |    +-- UnicodeError(*)
      |
      +-- SystemError
      +-- MemoryError

 
Classes
            
Exception
StandardError
ArithmeticError
FloatingPointError
OverflowError
ZeroDivisionError
AssertionError
AttributeError
EOFError
EnvironmentError
IOError
OSError
WindowsError
ImportError
KeyboardInterrupt
LookupError
IndexError
KeyError
MemoryError
NameError
UnboundLocalError
RuntimeError
NotImplementedError
SyntaxError
SystemError
TypeError
ValueError
UnicodeError
SystemExit

 
class ArithmeticError(StandardError)
      Base class for arithmetic errors.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class AssertionError(StandardError)
      Assertion failed.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class AttributeError(StandardError)
      Attribute not found.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class EOFError(StandardError)
      Read beyond end of file.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class EnvironmentError(StandardError)
      Base class for I/O related errors.
 
  
__getitem__(self, i) from Exception
__init__(self, *args)
__str__(self)

 
class Exception
      Proposed base class for all exceptions.
 
  
__getitem__(self, i)
__init__(self, *args)
__str__(self)

 
class FloatingPointError(ArithmeticError)
      Floating point operation failed.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class IOError(EnvironmentError)
      I/O operation failed.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from EnvironmentError
__str__(self) from EnvironmentError

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

 
class IndexError(LookupError)
      Sequence index out of range.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class KeyError(LookupError)
      Mapping key not found.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class KeyboardInterrupt(StandardError)
      Program interrupted by user.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class LookupError(StandardError)
      Base class for lookup errors.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class MemoryError(StandardError)
      Out of memory.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class NameError(StandardError)
      Name not found globally.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

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

 
class OSError(EnvironmentError)
      OS system call failed.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from EnvironmentError
__str__(self) from EnvironmentError

 
class OverflowError(ArithmeticError)
      Result too large to be represented.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class RuntimeError(StandardError)
      Unspecified run-time error.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class StandardError(Exception)
      Base class for all standard Python exceptions.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class SyntaxError(StandardError)
      Invalid syntax.
 
  
__getitem__(self, i) from Exception
__init__(self, *args)
__str__(self)

 
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__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class SystemExit(Exception)
      Request to exit from the interpreter.
 
  
__getitem__(self, i) from Exception
__init__(self, *args)
__str__(self) from Exception

 
class TypeError(StandardError)
      Inappropriate argument type.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

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

 
class UnicodeError(ValueError)
      Unicode related error.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class ValueError(StandardError)
      Inappropriate argument value (of correct type).
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from Exception
__str__(self) from Exception

 
class WindowsError(OSError)
      MS-Windows OS system call failed.
 
  
__getitem__(self, i) from Exception
__init__(self, *args) from EnvironmentError
__str__(self) from EnvironmentError

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

 
Data
             __file__ = '/usr/lib/python1.6/exceptions.pyc'
__name__ = 'exceptions'