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

Raymond Hettinger raymond.hettinger at verizon.net
Fri Aug 5 21:23:13 CEST 2005

> > When a user creates their own exception for exiting multiple levels
> > loops or frames, should they inherit from ControlFlowException on
> > theory that it no different in intent from StopIteration or should
> > inherit from UserError on the theory that it is a custom exception?
> I say ControlFlowException.  UserError is meant for quick-and-dirty
> exception usage and not as a base for user error exceptions.  If the
> name is confusing it can be changed to SimpleError.

Gads.  It sounds like you're just making this up on the fly.  The
process should be disciplined, grounded in use cases, and aimed at
known, real problems with the current hierarchy.

The above question was rhetorical.  It didn't have a right answer.
"Quick-and-dirty" is not a useful category and cannot be reliably placed
in one part of the tree versus another.  A common and basic use case for
quick and dirty exceptions is to break out of nested loops and
functions.  That is control flow as well as quick-and-dirty.


More information about the Python-Dev mailing list