[Python-Dev] Pre-PEP: Exception Reorganization for Python 3.0
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon Aug 1 04:57:18 CEST 2005
Nick Coghlan wrote:
> New Hierarchy
> =============
>
> Raisable (formerly Exception)
> +-- CriticalException (new)
> +-- KeyboardInterrupt
> +-- MemoryError
> +-- SystemError
> +-- ControlFlowException (new)
> +-- GeneratorExit
> +-- StopIteration
> +-- SystemExit
> +-- Exception (formerly StandardError)
If CriticalException and ControlFlowException are to be
siblings of Exception rather than subclasses of it, they
should be renamed so that they don't end with "Exception".
Otherwise there will be a confusing mismatch between the
actual inheritance hierarchy and the one suggested by
the naming.
Also, I'm not entirely happy about Exception no longer
being at the top, because so far the word "exception"
in relation to Python has invariably meant "anything
that can be raised". This terminology is even embedded
in the syntax with the try-except statement. Changing
this could to lead to some awkward circumlocutions
in the documentation and confusion in discussions.
--
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg.ewing at canterbury.ac.nz +--------------------------------------+
More information about the Python-Dev
mailing list