Wilfredo Sánchez Vega <wsanchez@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. Cheers, mwh -- <spiv> As far as I'm concerned, the meat pie is the ultimate unit of currency. -- from Twisted.Quotes