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

Nick Coghlan ncoghlan at gmail.com
Sun Jul 31 13:25:59 CEST 2005


Willem Broekema wrote:
> On 7/31/05, Brett Cannon <bcannon at gmail.com> wrote:
> 
>>While we do tend to use KeyboardInterrupt as a way to kill a
>>program, is that really control flow, or a critical exception
>>that the program needs to stop because an serious event
>>occurred?
> 
> 
> 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.

Actually, even in some such theoretical "Did you really mean that?" 
interpreter, the KeyboardInterrupt only gets raised if the interpreter 
determines that yes, the user really did want the program terminated. 
Otherwise, no exception is raised at all, and execution continues as usual.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.blogspot.com


More information about the Python-Dev mailing list