[Python-Dev] Comments of the PEP 3151

Nick Coghlan ncoghlan at gmail.com
Tue Jul 26 03:45:33 CEST 2011


On Tue, Jul 26, 2011 at 10:26 AM, Andrew Bennetts <andrew at bemusement.org> wrote:
> When EINTR happens it's frequently a surprise, but programmers new to
> the concept can always search the web for advice on what causes it and
> how to deal with it (and after several attempts at dealing with it they
> may even get it right).  Searching Google for “InterruptedError” isn't
> going to find anything helpful today, and eventually what I expect it
> would find is a bunch of pages saying “Look up EINTR.”  How about we
> just cut out that middle step and call it what the rest of the world
> calls it?
>
> If “InterruptedError” were going to be used for anything other than
> EINTR then I could see an argument for abstracting the concept behind a
> platform-independent name.  But I think it would be a mistake to treat
> anything else as being the same as EINTR.

The whole point of PEP 3151 is so that Python programmers can perform
key tasks without needing to worry about the existence of error
numbers under the hood. Including the cryptic errno abbreviations in
the interrupt names would completely miss the point.

However, the docs will point to appropriate information in the errno
module (and the exception details and docstrings may also mention the
errno codes). Abstractions do leak, after all, but that doesn't mean
we need to go punching holes in them with an icepick.

Cheers,
Nick.

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


More information about the Python-Dev mailing list