Raymond Hettinger wrote:
>... I propose that the transition plan be as simple as introducing
> BaseException. This allows people to write code that will work on both
> 2.x and 3.0. It doesn't break anything.
>
> The guidance for cross-version (2.5 to 3.0) code would be:
>
> * To catch all but terminating exceptions, write:
>
> except (KeyError, SystemExit):
> raise
> except Exception:
> ...
How about:
except BaseException, error:
if not isinstance(error, Exception):
raise
...
This would accommodate other invented exceptions such as
"FoundConvergance(BaseException)", which is my pseudo-example
for an exiting exception that is not properly a subclass of
either KeyError or SystemExit. The idea is a relaxation stops
when it doesn't move and may start generating something silly
like divide-by-zero. Not the end of an App, but the end of a Phase.
--Scott David Daniels
[EMAIL PROTECTED]
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com