1.1 --- a/lib/__builtins__/core.py Thu Jan 12 23:29:39 2017 +0100
1.2 +++ b/lib/__builtins__/core.py Thu Jan 12 23:50:26 2017 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Core objects.
1.6
1.7 -Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -113,18 +113,57 @@
1.13
1.14 __repr__ = __str__
1.15
1.16 -class BaseException:
1.17 +class Exception:
1.18
1.19 "The root of all exception types."
1.20
1.21 pass
1.22
1.23 -class Exception(BaseException): pass
1.24 -class MemoryError(Exception): pass
1.25 -class OverflowError(Exception): pass
1.26 -class TypeError(Exception): pass
1.27 -class UnboundMethodInvocation(Exception): pass
1.28 -class Warning: pass
1.29 -class ZeroDivisionError(Exception): pass
1.30 +# Fundamental exceptions
1.31 +
1.32 +class MemoryError(Exception):
1.33 +
1.34 + "An error indicating failure to allocate or manage memory."
1.35 +
1.36 + pass
1.37 +
1.38 +class TypeError(Exception):
1.39 +
1.40 + "An error indicating unsuitable type usage."
1.41 +
1.42 + pass
1.43 +
1.44 +class UnboundMethodInvocation(Exception):
1.45 +
1.46 + "An error indicating an attempt to call an unbound method."
1.47 +
1.48 + pass
1.49 +
1.50 +class ArithmeticError(Exception):
1.51 +
1.52 + "A general arithmetic operation error."
1.53 +
1.54 + pass
1.55 +
1.56 +class FloatingPointError(Exception):
1.57 +
1.58 + "A floating point operation error."
1.59 +
1.60 + pass
1.61 +
1.62 +class OverflowError(ArithmeticError):
1.63 +
1.64 + """
1.65 + Indicates that an arithmetic operation produced a result that could not be
1.66 + represented.
1.67 + """
1.68 +
1.69 + pass
1.70 +
1.71 +class ZeroDivisionError(ArithmeticError):
1.72 +
1.73 + "An error occurring when an attempt was made to divide an operand by zero."
1.74 +
1.75 + pass
1.76
1.77 # vim: tabstop=4 expandtab shiftwidth=4