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

Phillip J. Eby pje at telecommunity.com
Tue Aug 2 17:39:19 CEST 2005


At 04:13 PM 8/2/2005 +0900, Stephen J. Turnbull wrote:
>Now, somebody proposed:
>
>Raisable -+- Exception
>           +- ...
>           +- ControlFlowException -+- StopIteration
>                                    +- KeyboardInterrupt
>
>As I wrote above, I see no use for that; I think that's what you're
>saying too, right?  AIUI, you want
>
>Raisable -+- Exception
>           +- ...
>           +- StopIteration
>           +- KeyboardInterrupt
>
>so that only the appropriate control construct or an explicit except
>can catch a control flow exception.

No, I want ControlFlowException to exist as a parent so that code today can 
work around the fact that bare "except:" and "except Exception:" catch 
everything.  In Python 3.0, we should have "except Error:" and be able to 
have it catch everything but control flow exceptions and possibly critical 
errors.



More information about the Python-Dev mailing list