[Python-Dev] PEP 344 (original) (raw)
Michael Foord fuzzyman at voidspace.org.uk
Sat Mar 3 01:32:56 CET 2007
- Previous message: [Python-Dev] PEP 344 (was: with_traceback)
- Next message: [Python-Dev] PEP 344
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido van Rossum wrote:
[snip..] The one thing that makes me not want to give up yet is that having the traceback, context, cause etc. as attributes of the exception object would seem to make the API for handling exceptions that much cleaner, compared to having to call sys.excinfo() or even "except E as v with tb".
So, despite the existence of libraries that pre-create exceptions, how bad would it really be if we declared that use unsafe? It wouldn't be hard to add some kind of boobytrap that goes off when pre-created exceptions are raised multiple times. If this had always been the semantics I'm sure nobody would have complained and I doubt that it would have been a common pitfall either (since if it doesn't work, there's no bad code abusing it, and so there are no bad examples that newbies could unwittingly emulate). Personally, I think the new attributes and the new syntax are great improvements to exception handling. I would be sad to see parts of these proposals not happen.
Michael Foord
- Previous message: [Python-Dev] PEP 344 (was: with_traceback)
- Next message: [Python-Dev] PEP 344
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]