[Python-checkins] python/nondist/peps pep-0348.txt,1.6,1.7

bcannon@users.sourceforge.net bcannon at users.sourceforge.net
Tue Aug 9 06:26:30 CEST 2005


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27247

Modified Files:
	pep-0348.txt 
Log Message:
Scale back proposal even more: VMError and AnyDeprecationWarning have been
removed along with EOFError no longer inheriting from IOError.
TerminalException was renamed TerminatingException.

At this point the only changes to the exception hierarchy are the addition of
BaseException and TerminatingException, and the change of inheritance for
KeyboardInterrupt, SystemExit, and NotImplementedError.


Index: pep-0348.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0348.txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pep-0348.txt	9 Aug 2005 02:46:12 -0000	1.6
+++ pep-0348.txt	9 Aug 2005 04:26:28 -0000	1.7
@@ -7,7 +7,7 @@
 Type: Standards Track
 Content-Type: text/x-rst
 Created: 28-Jul-2005
-Post-History: 03-Aug-2005
+Post-History:
 
 
 Abstract
@@ -104,7 +104,7 @@
 .. parsed-literal::
 
    +-- BaseException (new; broader inheritance for subclasses)
-       +-- TerminalException (new; stricter inheritance for subclasses)
+       +-- TerminatingException (new; stricter inheritance for subclasses)
 	   +-- KeyboardInterrupt
 	   +-- SystemExit
        +-- Exception
@@ -118,12 +118,13 @@
 	       +-- AttributeError
 	       +-- EnvironmentError
 		   +-- IOError
-		       +-- EOFError (broader inheritance)
+		   +-- EOFError
 		   +-- OSError
 	       +-- ImportError
 	       +-- LookupError
 		   +-- IndexError
 		   +-- KeyError
+	       +-- MemoryError
 	       +-- NameError
 		   +-- UnboundLocalError
 	       +-- NotImplementedError (stricter inheritance)
@@ -137,15 +138,12 @@
 		   +-- UnicodeEncodeError
 		   +-- UnicodeTranslateError
 	       +-- ValueError
-	       +-- VMError (new; broader inheritance for subclasses)
-		   +-- MemoryError
-		   +-- SystemError
 	       +-- ReferenceError
 	   +-- StopIteration
+	   +-- SystemError
 	   +-- Warning
-	       +-- AnyDeprecationWarning (new; broader inheritance for subclasses)
-		   +-- PendingDeprecationWarning
-		   +-- DeprecationWarning
+	       +-- PendingDeprecationWarning
+	       +-- DeprecationWarning
 	       +-- FutureWarning
 	       +-- SyntaxWarning
 	       +-- RuntimeWarning
@@ -171,30 +169,17 @@
 The superclass that all exceptions must inherit from.
 
 
-TerminalException
-'''''''''''''''''
+TerminatingException
+''''''''''''''''''''
 
 Superclass for exceptions that are meant to the termination of the
 interpreter.  It does not inherit from Exception so that
 subclasses are not caught by bare ``except`` clauses.
 
-
-VMError
-'''''''
-
-Superclass for exceptions that deal directly with the virtual
-machine.
-
-
-AnyDeprecationWarning
-'''''''''''''''''''''
-
-A common superclass for all deprecation-related exceptions.  While
-having DeprecationWarning inherit from PendingDeprecationWarning was
-suggested (a DeprecationWarning can be viewed as a
-PendingDeprecationWarning that is happening now), the logic was not
-agreed upon by a majority.  But since the exceptions are related,
-creating a common superclass is warranted.
+Naming based on the idea that the interpreter is trying to terminate when these
+exceptions are raised.  An earlier proposal suggested "TerminalException" but
+avoidance of any confusion with an actual terminal along with "terminal" being
+more fatalistic than "terminating" led to the current name choice.
 
 
 Removed Exceptions
@@ -221,15 +206,6 @@
 Exception.
 
 
-EOFError
-''''''''
-
-Subclasses IOError.
-
-Since an EOF comes from I/O it only makes sense that it be considered
-an I/O error.
-
-
 Required Superclass for ``raise``
 =================================
 
@@ -446,6 +422,30 @@
 causing existing Python programmers extra pain, the renamings were
 removed.
 
+Have EOFError Subclass IOError
+------------------------------
+
+The original thought was that sine EOFError deals directly with I/O, it should
+subclass IOError.  But since EOFError is used more as a signal that an event
+has occurred (the exhaustion of an I/O port), it should not subclass such a
+specific error exception.
+
+
+Have MemoryError and SystemError Have a Common Superclass
+---------------------------------------------------------
+
+Both classes deal with the interpreter, so why not have them have a common
+superclass?  Because one of them means that the interpreter is in a state that
+it should not recover from while the other does not.
+
+
+Common Superclass for PendingDeprecationWarning and DeprecationWarning
+----------------------------------------------------------------------
+
+Grouping the deprecation warning exceptions together makes intuitive sense.
+But this sensical idea does not extend well when one considers how rarely
+either warning is used, let along at the same time.
+
 
 Acknowledgements
 ================



More information about the Python-checkins mailing list