[Python-Dev] PEP, take 2: Exception Reorganization for Python 3.0

Brett Cannon bcannon at gmail.com
Wed Aug 3 23:12:09 CEST 2005


On 8/3/05, Russell E. Owen <rowen at cesmail.net> wrote:
> In article <bbaeab1005080217346b2af653 at mail.gmail.com>,
>  Brett Cannon <bcannon at gmail.com> wrote:
> 
> > New Hierarchy
> > =============
> >
> > Exception
[SNIP]
> > +-- StandardError
[SNIP]
> >     +-- EnvironmentError
> >       +-- OSError
> >       +-- IOError
> >           +-- EOFError (new inheritance)
[SNIP]
> 
> I am wondering why OSError and IOError are not under StandardError? This
> seems a serious misfeature to me (perhaps the posting was just
> misformatted?).
> 

Look again; they are with an inheritance for both of (OS|IO)Error <-
EnvironmentError <- StandardError <- Exception.

> Having one class for "normal" errors (not exceptions whose sole purpose
> is to halt the program and not so critical that any continuation is
> hopeless) sure would make it easier to write code that output a
> traceback and tried to continue. I'd love it.
> 

That is what StandardError is for.

-Brett


More information about the Python-Dev mailing list