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

Brett Cannon bcannon at gmail.com
Fri Aug 5 23:20:34 CEST 2005


On 8/5/05, Guido van Rossum <gvanrossum at gmail.com> wrote:
[SNIP]
> Those legitimate uses often need to make a special case of
> Keyboardinterrupt and SystemExit -- KeyboardInterrupt because it's not
> a bug in the code but a request from the user who is *running* the app
> (and the appropriate default response is to exit with a stack trace);
> SystemExit because it's not a bug but a deliberate attempt to exit the
> program -- logging an error would be a mistake.
> 
> I think the use cases for moving other exceptions out of the way are
> weak; MemoryError and SystemError are exceedingly rare and I've never
> felt the need to exclude them; when GeneratorExit or StopIteration
> reach the outer level of an app, it's a bug like all the others that
> bare 'except:' WANTS to catch.
> 

So are you saying you would rather ditch all reorganization
suggestions and just have SystemExit and KeyboardInterrupt inherit
directly from BaseException, and keep the bare 'except' change and
required superclass inheritance suggestions?  Would this appease
everyone else?

If this is what people want, fine.  But I am still going to suggest
CriticalError stay since they are not caused by programmer error
directly (I am ignoring C extension module screw-ups that devour
memory).

-Brett


More information about the Python-Dev mailing list