On 12Apr2015 16:33, Cameron Simpson <c...@zip.com.au> wrote:
Finally, if we were to expunge support for "except:", one would also need a cast iron guarrentee that no exception could possibly occur which was not a subclass of BaseException. I'd expect that to mean that "raise" of a non-instance of BaseException to itself raise a TypeError.

And I see that Steven D'Aprano has already pointed out PEP 352:

 http://www.python.org/dev/peps/pep-0352/

which is marked "Status: Final". It says:

The raise statement will be changed to require that any object passed to it must inherit from BaseException. This will make sure that all exceptions fall within a single hierarchy that is anchored at BaseException [2] . This also guarantees a basic interface that is inherited from BaseException. The change to raise will be enforced starting in Python 3.0 (see the Transition Plan below).

Hmm. Not in 2.7? I can see the breakage it could cause, but where does that leave me? I think I could probably move to catching Exception almost across the board even in 2.5+ and feel pretty good.

Cheers,
Cameron Simpson <c...@zip.com.au>

If your new theorem can be stated with great simplicity, then there
will exist a pathological exception.    - Adrian Mathesis
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to