On 7/31/05, Brett Cannon <[EMAIL PROTECTED]> 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. The behaviour of the current Python interpreters is that upon encountering an uncaught KeyboardInterrupt (as with any uncaught exception), computation is aborted and a backtrace printed. But that is not how it /must be/ as there might be alternative interpreters that upon encountering an uncaught KeyboardInterrupt will pause execution of the program, but then allow the user to either continue or abort execution, effectively not stopping but pausing the program. Because of this possible recovery, thinking of KeyboardInterrupt as "in order to abort the program, the user has caused a keyboard interrupt" is wrong; it should be more like just "the user has interrupted the computation" and whether or not the program is consequently aborted is not predefined. - Willem _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com