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

Brett Cannon bcannon at gmail.com
Fri Aug 5 23:09:30 CEST 2005


On 8/5/05, Raymond Hettinger <raymond.hettinger at verizon.net> wrote:
> > > When a user creates their own exception for exiting multiple levels
> of
> > > loops or frames, should they inherit from ControlFlowException on
> the
> > > theory that it no different in intent from StopIteration or should
> they
> > > 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.
> 

It is based on a real use case; my own.  As I said in another email I
just sent, I had no clue that RuntimeError was meant to be used as a
generic exception until Guido pointed it out.

-Brett


More information about the Python-Dev mailing list