[Python-Dev] Exception Reorg PEP checked in

Michael Hudson mwh at python.net
Sun Aug 14 21:21:31 CEST 2005

Wilfredo Sánchez Vega <wsanchez at wsanchez.net> writes:

>    I'm curious about why Python lacks FileNotFoundError,  
> PermissionError and the like as subclasses of IOError.

Good question.  Lack of effort/inertia?

>    Catching IOError and looking at errno to figure out what went  
> wrong seems pretty unpythonic, and I've often wished for built-in  
> subclasses of IOError.

The py library does this (http://codespeak.net/py).

>    I sometimes subclass them myself, but a lot of the time, I'm  
> catching such exceptions as thrown by the standard library.

Well, indeed.  OTOH, functions like os.open aren't really *meant* to
be pythonic.

I don't think this is something I can get interested enough in to work
on myself.


  <spiv> As far as I'm concerned, the meat pie is the ultimate unit
         of currency.                           -- from Twisted.Quotes

More information about the Python-Dev mailing list