[Python-Dev] Pre-PEP: Exception Reorganization for Python 3.0

Fred L. Drake, Jr. fdrake at acm.org
Sun Jul 31 16:41:47 CEST 2005


On Sunday 31 July 2005 06:36, Willem Broekema wrote:
 > I does not seem right to me to think of KeyboardInterrupt as a means
 > to cause program halting. An interpreter could in principle recover
 > from it and resume execution of the program.

Somewhat.  An interrupt may well not mean that the program should terminate, 
but may simply mean that the current operation should be stopped (as in many 
sorts of command interpreters).  It's still *reasonable* to exit the Python 
interpreter if the application doesn't handle it; I can't think of any other 
reasonable default interpretation.  (The interactive interpreter is simply an 
application that does handle the interrupt in an application-specific way.)

So I think its reasonable to consider it a critical exception, because it's 
not predictable the way the control flow exceptions are; it's user-generated 
instead of application-generated.


  -Fred

-- 
Fred L. Drake, Jr.   <fdrake at acm.org>


More information about the Python-Dev mailing list