[Python-ideas] PEP 3151: Reworking the OS and IO exception hierarchy

Nick Coghlan ncoghlan at gmail.com
Sun Jul 25 05:12:24 CEST 2010

2010/7/25 Ivan Pozdeev <vano at mail.mipt.ru>:
> Здравствуйте, Nick.
> Вы писали 24 июля 2010 г., 14:12:31:
>> Why is that a problem? Some errnos *are* more important than others -
>> they're the ones the regularly appear on the right hand side of "errno
>> == <some_errno>" checks.
>> Why would you consider new classes that would be based on a survey of
>> the errnos that developers actually check for in published code to be
>> "arbitrary"?
> Since the list would be a sole opinion of some people who take part in
> the survey, you'll be constantly faced with demands of other people
> who want to have "shortcuts" for something else too.
> And you won't be able to explain why your choice is more preferable than theirs.

As Alexander pointed out, the word survey has multiple meanings. One
of those is the subjective approach you're objecting to (ask a bunch
of people what they think), another is the more objective approach
actually documented in the PEP (go and look at what is out there, as
in the sense of "land survey"). Think "code survey" rather than
"developer survey". (A scripted tool to gather statistics on exception
handling in this space from Google code search results and direct
scans of local Python code bases would actually be helpful, even if it
wasn't 100% accurate)

There is still a subjective step in whittling the code survey results
down into a revised class heirarchy, but that's:
- why it's a separate step in the PEP, independent of the consolidation step
- why the PEP doesn't include a concrete proposal as yet
- one of the main goals of discussion of the PEP here and across the
wider Python community

Language design is inherently a matter of judgment. Based on the way
it has played out in practice (frequently requiring explicit errno
checks and catching of multiple exception types in order to write
correct code), we now think the previous judgment in relation to the
EnvironmentError exception hierarchy is demonstrably flawed. That
doesn't mean we throw our hands up in the air and give up - it means
we knuckle down and try to come up with something better, based on
what we can learn from what has gone before.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list