Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-06 Thread Raymond Hettinger
> The remainder of my message then goes on to describe a hierarchy just as > you > suggest - SystemError, MemoryError, StopIteration and GeneratorExit are > all > still caught by "except Exception:". The only two exceptions which are no > longer caught by "except Exception:" are KeyboardInterrupt a

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-06 Thread Nick Coghlan
Raymond Hettinger wrote: > Please read my other, detailed post on this (8/5/2005 4:05pm). It is a > mistake to bypass control flow exceptions like GeneratorExit and > StopIteration. Those need to remain under Exception. This is the paragraph after the one you replied to above: [Nick Coghlan] >

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-06 Thread Raymond Hettinger
[Nick Coghlan] > As others have pointed out, GeneratorExit and StopIteration should never > reach > the job execution loop - if they do, there's a bug in the job, and they > should > be caught and logged. Please read my other, detailed post on this (8/5/2005 4:05pm). It is a mistake to bypass con

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-06 Thread Nick Coghlan
Guido van Rossum wrote: > The point is not to avoid bare 'except:' from hiding programming > errors. There's no hope to obtain that goal. > > The point is to make *legitimate* uses of bare 'except:' easier -- the > typical use case is an application that has some kind of main loop > which uses bar

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Brett Cannon
On 8/5/05, Guido van Rossum <[EMAIL PROTECTED]> wrote: [SNIP] > Those legitimate uses often need to make a special case of > Keyboardinterrupt and SystemExit -- KeyboardInterrupt because it's not > a bug in the code but a request from the user who is *running* the app > (and the appropriate default

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Brett Cannon
On 8/5/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > When a user creates their own exception for exiting multiple levels > of > > > loops or frames, should they inherit from ControlFlowException on > the > > > theory that it no different in intent from StopIteration or should > they > > >

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Guido van Rossum
On 8/5/05, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > While I agree with most of your -1's on gratuitous changes, this particular > problem isn't gratuitous. A StopIteration that reaches a regular exception > handler is a programming error; allowing StopIteration and other > control-flow exceptio

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Reinhold Birkenfeld
Raymond Hettinger wrote: > 2. There is a lesson to be taken from a story in the ACM risks forum > where a massive phone outage was traced to a single line of C code that > ran a "break" to get out of a nested if-statement. The interesting part > is that this was known to be mission critical code

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Raymond Hettinger
[Raymond Hettinger wrote] > >The PEP moves StopIteration out from under Exception so that it cannot > >be caught by a bare except or an explicit "except Exception". > > > >IMO, this is a mistake. In either form, a programmer is stating that > >they want to catch and handle just about anything. Th

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread James Y Knight
On Aug 5, 2005, at 2:46 PM, Raymond Hettinger wrote: > The PEP moves StopIteration out from under Exception so that it cannot > be caught by a bare except or an explicit "except Exception". > > IMO, this is a mistake. In either form, a programmer is stating that > they want to catch and handle j

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Raymond Hettinger
> > When a user creates their own exception for exiting multiple levels of > > loops or frames, should they inherit from ControlFlowException on the > > theory that it no different in intent from StopIteration or should they > > inherit from UserError on the theory that it is a custom exception? >

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Phillip J. Eby
At 02:46 PM 8/5/2005 -0400, Raymond Hettinger wrote: >The PEP moves StopIteration out from under Exception so that it cannot >be caught by a bare except or an explicit "except Exception". > >IMO, this is a mistake. In either form, a programmer is stating that >they want to catch and handle just ab

Re: [Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Brett Cannon
On 8/5/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > The PEP moves StopIteration out from under Exception so that it cannot > be caught by a bare except or an explicit "except Exception". > > IMO, this is a mistake. In either form, a programmer is stating that > they want to catch and handle

[Python-Dev] PEP 348: Exception Reorganization for Python 3.0

2005-08-05 Thread Raymond Hettinger
The PEP moves StopIteration out from under Exception so that it cannot be caught by a bare except or an explicit "except Exception". IMO, this is a mistake. In either form, a programmer is stating that they want to catch and handle just about anything. There is a reasonable argument that SystemE