Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: Undefined behaviour in C [was Re: The Cost of Dynamism] Date: Sat, 26 Mar 2016 16:44:41 -0400 Lines: 50 Message-ID: References: <56ef9787$0$1516$c3e8da3$5496439d@news.astraweb.com> <56f02196$0$1588$c3e8da3$5496439d@news.astraweb.com> <56f42d9f$0$1618$c3e8da3$5496439d@news.astraweb.com> <56f55e2e$0$1619$c3e8da3$5496439d@news.astraweb.com> <56f666d8$0$1583$c3e8da3$5496439d@news.astraweb.com> <2e1ce88d-fae2-4aa0-ace9-4faa4878459b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 6S61Jzqcnwa+NsgYfAuR8wPpeMl8xFw0BXkuvivp/0Ig== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; "'no": 0.09; 'errno': 0.09; 'ioerror': 0.09; 'oserror': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'jan': 0.11; 'exception': 0.13; '+--': 0.16; '3.3.': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'subclassing': 0.16; 'wrote:': 0.16; 'integer': 0.18; 'typical': 0.18; 'errors': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'figure': 0.27; 'device': 0.28; 'subject: [': 0.29; 'statement': 0.32; 'point': 0.33; 'url:python': 0.33; 'file': 0.34; 'but': 0.36; 'instead': 0.36; 'there': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'why': 0.39; 'to:addr:python.org': 0.40; 'space': 0.40; 'called': 0.40; 'url:3': 0.60; 'subject:The': 0.61; 'skip:n 10': 0.62; 'received:96': 0.63; 'matter.': 0.66; 'natural': 0.67; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-96-227-207-81.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <2e1ce88d-fae2-4aa0-ace9-4faa4878459b@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105783 On 3/26/2016 1:43 PM, Rustom Mody wrote: > There is this nice piece of OO called the exception hierarchy: > https://docs.python.org/2/library/exceptions.html#exception-hierarchy https://docs.python.org/3/library/exceptions.html#exception-hierarchy > BaseException =E2=8A=87 Exception =E2=8A=87 EnvironmentError =E2=8A=87 = IOError BaseException =E2=8A=87 Exception =E2=8A=87 =E2=8A=87 OSError > At this point it would have been completely natural for IOError to cont= inue > subclassing to all the typical errors > - File not found > - No Space left on device Which is why we now have +-- OSError | +-- BlockingIOError | +-- ChildProcessError | +-- ConnectionError | | +-- BrokenPipeError | | +-- ConnectionAbortedError | | +-- ConnectionRefusedError | | +-- ConnectionResetError | +-- FileExistsError | +-- FileNotFoundError | +-- InterruptedError | +-- IsADirectoryError | +-- NotADirectoryError | +-- PermissionError | +-- ProcessLookupError | +-- TimeoutError 'no space' is MemoryError, but that is a hardward, not OS matter. > But instead we have an integer errno and we must inquire what that is t= o > figure out what the exact IOError was This statement is obsolete, but explains why the above was added in 3.3. --=20 Terry Jan Reedy