[Python-Dev] Exception Reorg PEP revised yet again

Raymond Hettinger raymond.hettinger at verizon.net
Wed Aug 10 01:15:17 CEST 2005


[Brett]
> The problem with existing code checking for this situation is that the
> situation itself is not the same as it will be if bare 'except's
> change::
> 
>  try:
>    ...
>  except:
>    ...
>  except TerminatingException:
>    ...
> 
> has never really been possible before, but will be if the PEP goes
> forward.

That's not an improvement.  The above code fragment should trigger a gag
reflex indicating that something is wrong with the proposed default for
a bare except.



> Having a catch-all for
> exceptions that a bare 'except' will skip that is more explicit than
> ``except BaseException`` seems reasonable to me.  

The data gathered by Jack and Steven's research indicate that the number
of cases where TerminatingException would be useful is ZERO.  Try not to
introduce a new builtin that no one will ever use.  Try not to add a new
word whose only function is to replace a two-word tuple (TOOWTDI).  Try
not to unnecessarily nest the tree (FITBN).  Try not to propose
solutions to problems that don't exist (PBP).  



Raymond



More information about the Python-Dev mailing list